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}
	...
master
Jose M. Guisado 2021-03-29 13:42:45 +02:00 committed by OpenGnSys Support Team
parent 0f55ce7341
commit e81c38f098
1 changed files with 2 additions and 2 deletions

View File

@ -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]])