An example would be better, consider this silly one:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--foo', nargs='+', help='Spam egg')
parser.parse_args()
When I run the ---help:
usage: foos.py [-h] [-f FOO [FOO ...]]
optional arguments:
-h, --help show this help message and exit
-f FOO [FOO ...], --foo FOO [FOO ...]
Spam egg
As i have used nargs ='+', i am getting -f FOO [FOO ...] and similarly -foo FOO [FOO ...], but i want just one FOO to be shown in the --help i.e. i want:
usage: foos.py [-h] [-f FOO]
optional arguments:
-h, --help show this help message and exit
-f FOO, --foo FOO
Spam egg
I have taken a look at the argparse doc but could not find anything similar. How can i do this?
FOO [FOO ...]is just the syntax for at least one, but possibly more, arguments.nargs='+', but can I drop that reference from help?