aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-06-08 21:17:06 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-06-08 21:17:06 +0200
commite74e24b0825104ba48b29a7622e1c3115111f979 (patch)
treef4402c33d8f9211bd11434edd347ab07491361ff
parent9a959c22403f4c5aa111531c3c3b626dfbb97251 (diff)
downloadrefcat-e74e24b0825104ba48b29a7622e1c3115111f979.tar.gz
refcat-e74e24b0825104ba48b29a7622e1c3115111f979.zip
cli: docs
-rw-r--r--python/refcat/cli.py12
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: