Skip to content

Commit 4e636f5

Browse files
author
Miłosz Skaza
authored
Add option to use certain commands outside of a ctfcli project (#136)
- extract challenge resolving code from each command to a reusable method - stop relying on config whenever it's not necessary (challenge new, format, lint) - improve variable naming (explicit `challenge_instance` instead of shadowing the `challenge` kwarg) - fix some typos Closes #135
1 parent 91872e0 commit 4e636f5

File tree

4 files changed

+259
-294
lines changed

4 files changed

+259
-294
lines changed

ctfcli/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def main():
133133
# if the command returns an int, then we serialize it as none to prevent fire from printing it
134134
# (this does not change the actual return value, so it's still good to use as an exit code)
135135
# everything else is returned as is, so fire can print help messages
136-
ret = fire.Fire(CTFCLI, serialize=lambda r: None if isinstance(r, int) else r)
136+
ret = fire.Fire(COMMANDS["cli"], serialize=lambda r: None if isinstance(r, int) else r)
137137

138138
if isinstance(ret, int):
139139
sys.exit(ret)

0 commit comments

Comments
 (0)