diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/refcat/cli.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/python/refcat/cli.py b/python/refcat/cli.py index 5d62918..7e3804c 100644 --- a/python/refcat/cli.py +++ b/python/refcat/cli.py @@ -71,7 +71,7 @@ def effective_task_names(): def tasks(): """ - Print task name. + Print task names. """ for name in effective_task_names(): print(name) @@ -79,7 +79,7 @@ def tasks(): def files(): """ - Print task name and file. + Print task names and output file. """ for name in effective_task_names(): klass = Register.get_task_cls(name) @@ -89,9 +89,9 @@ def files(): print("{:40s}".format(name)) -def cat(*args): +def cat(): """ - Inspect file. + File contents to stdout. """ if len(sys.argv) < 2: raise ValueError("task name required") @@ -218,9 +218,11 @@ def main(): if len(sys.argv) >= 2 and sys.argv[1] in sub_commands: try: + # A hack to call the function within this file matching the + # subcommand name. func = globals()[sys.argv[1]] if callable(func): - func(*sys.argv[2:]) + func() else: print("not implemented: {}".format(sys.argv[1])) except KeyError: |