From b1fc9cabb46719f2b9319ead63cafea7a745f710 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Thu, 5 Oct 2023 11:21:19 +0200 Subject: 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"). --- cli/objects/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/objects/client.py') 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=[], -- cgit v1.2.3-18-g5258