summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-03-29 13:42:45 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-03-29 13:54:37 +0200
commite81c38f098a5fb71c2e9238354fdfc658f413743 (patch)
tree584deb6591be0e9f449ca959786a2b0b49219f84 /cli
parent0f55ce73415465d01f3490a8b1e770d116210eda (diff)
Fix help messages
program name of subsequent parsers after the first one need their "prog=" parameter specified so they do not show sys.argv[0] only. With this patch, for example: ogcli list --help Shows: usage: ogcli list [-h] {clients,scopes,modes,hardware,client} ... Instead of: usage: ogcli [-h] {clients,scopes,modes,hardware,client} ...
Diffstat (limited to 'cli')
-rw-r--r--cli/cli.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/cli.py b/cli/cli.py
index 87fc772..0e7c749 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -51,7 +51,7 @@ class OgCLI():
def list(self, args):
choices = ['clients', 'scopes', 'modes', 'hardware',
'client']
- parser = argparse.ArgumentParser()
+ parser = argparse.ArgumentParser(prog='ogcli list')
parser.add_argument('item', choices=choices)
parsed_args = parser.parse_args([args[0]])
@@ -68,7 +68,7 @@ class OgCLI():
def set(self, args):
choices = ['modes']
- parser = argparse.ArgumentParser()
+ parser = argparse.ArgumentParser(prog='ogcli set')
parser.add_argument('item', choices=choices)
parsed_args = parser.parse_args([args[0]])