mirror of https://git.48k.eu/ogcli/
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
parent
0f55ce7341
commit
e81c38f098
|
@ -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]])
|
||||
|
||||
|
|
Loading…
Reference in New Issue