diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2023-10-05 11:21:19 +0200 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2023-10-05 11:21:19 +0200 |
commit | b1fc9cabb46719f2b9319ead63cafea7a745f710 (patch) | |
tree | b6fe4c07ad777f6ab738ced721c51ba37e6b27e9 /cli/objects/server.py | |
parent | a721957cc46983f3026a30ea2dc814f5eafed1c2 (diff) |
objects: add missing prog parameter in subcommands
The specific subcommand name is missing in some of the subcommands help
message. For example:
$ ogcli list hardware
usage: ogcli [-h] --client-ip CLIENT_IP
ogcli: error: the following arguments are required: --client-ip
Fix this by adding the missing prog= parameter so argparse use this
instead of argv[0]. If no prog parameter is specified then argv[0] is
printed (i.e: "ogcli").
Diffstat (limited to 'cli/objects/server.py')
-rw-r--r-- | cli/objects/server.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/objects/server.py b/cli/objects/server.py index a8ed345..4a03d63 100644 --- a/cli/objects/server.py +++ b/cli/objects/server.py @@ -18,7 +18,7 @@ class OgServer(): @staticmethod def add_server(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli add server') parser.add_argument('--address', nargs='?', required=True, @@ -29,7 +29,7 @@ class OgServer(): @staticmethod def delete_server(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli delete server') parser.add_argument('--id', nargs='?', required=True, @@ -40,7 +40,7 @@ class OgServer(): @staticmethod def set_server(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli set server') parser.add_argument('--id', nargs='?', required=True, |