diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2021-03-29 13:42:45 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-03-29 13:54:37 +0200 |
commit | e81c38f098a5fb71c2e9238354fdfc658f413743 (patch) | |
tree | 584deb6591be0e9f449ca959786a2b0b49219f84 | |
parent | 0f55ce73415465d01f3490a8b1e770d116210eda (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}
...
-rw-r--r-- | cli/cli.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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]]) |