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 | |
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')
-rw-r--r-- | cli/objects/client.py | 6 | ||||
-rw-r--r-- | cli/objects/disks.py | 4 | ||||
-rw-r--r-- | cli/objects/images.py | 6 | ||||
-rw-r--r-- | cli/objects/poweroff.py | 2 | ||||
-rw-r--r-- | cli/objects/reboot.py | 2 | ||||
-rw-r--r-- | cli/objects/server.py | 6 | ||||
-rw-r--r-- | cli/objects/wol.py | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/cli/objects/client.py b/cli/objects/client.py index dbb7f15..c3ad760 100644 --- a/cli/objects/client.py +++ b/cli/objects/client.py @@ -19,7 +19,7 @@ class OgClient(): @staticmethod def list_client_hardware(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli list hardware') parser.add_argument('--client-ip', nargs=1, type=str, @@ -33,7 +33,7 @@ class OgClient(): @staticmethod def get_client_properties(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli list client') parser.add_argument('--client-ip', nargs=1, required=True, @@ -46,7 +46,7 @@ class OgClient(): @staticmethod def send_refresh(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli send refresh') parser.add_argument('--client-ip', action='append', default=[], diff --git a/cli/objects/disks.py b/cli/objects/disks.py index 4df9994..d1a9ed7 100644 --- a/cli/objects/disks.py +++ b/cli/objects/disks.py @@ -15,7 +15,7 @@ class OgDisk(): @staticmethod def list_disks(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli list disks') parser.add_argument('--client-ip', nargs='?', required=True, @@ -44,7 +44,7 @@ class OgDisk(): part_types = ['LINUX', 'EFI', 'WINDOWS', 'CACHE'] fs_types = ['EXT4', 'FAT32', 'NTFS', 'CACHE'] - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli setup disk') parser.add_argument('--type', nargs='?', required=True, diff --git a/cli/objects/images.py b/cli/objects/images.py index f0e2076..a5faa12 100644 --- a/cli/objects/images.py +++ b/cli/objects/images.py @@ -20,7 +20,7 @@ class OgImage(): @staticmethod def restore_image(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli restore image') parser.add_argument('--disk', nargs='?', required=True, @@ -101,7 +101,7 @@ class OgImage(): @staticmethod def create_image(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli create image') parser.add_argument('--disk', nargs='?', required=True, @@ -156,7 +156,7 @@ class OgImage(): @staticmethod def update_image(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli update image') parser.add_argument('--disk', nargs='?', required=True, diff --git a/cli/objects/poweroff.py b/cli/objects/poweroff.py index da3666c..791dd80 100644 --- a/cli/objects/poweroff.py +++ b/cli/objects/poweroff.py @@ -14,7 +14,7 @@ class OgPoweroff(): @staticmethod def send_poweroff(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli send poweroff') group = parser.add_argument_group( 'clients', 'Client selection options') group.add_argument('--center-id', diff --git a/cli/objects/reboot.py b/cli/objects/reboot.py index 6110007..8a12ede 100644 --- a/cli/objects/reboot.py +++ b/cli/objects/reboot.py @@ -14,7 +14,7 @@ class OgReboot(): @staticmethod def send_reboot(rest, args): - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli send reboot') group = parser.add_argument_group( 'clients', 'Client selection options') group.add_argument('--center-id', 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, diff --git a/cli/objects/wol.py b/cli/objects/wol.py index e788ce1..5097bd7 100644 --- a/cli/objects/wol.py +++ b/cli/objects/wol.py @@ -26,7 +26,7 @@ class OgWol(): return lookup return None - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser(prog='ogcli send wol') parser.add_argument('--type', nargs='?', choices=['broadcast', 'unicast'], |