I'd like to add some command line switches to my script, to which I use the argparse.
The related part of my script so far looks like:
import argparse
parser = argparse.ArgumentParser(prog="Hola python",description="Hola")
parser.add_argument('-i', '--input', help="helpppping")
parser.print_help()
However this results in:
usage: Hola python [-h] [-i INPUT]
Hola
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
helpppping
My concerns is with this row
-i INPUT, --input INPUT
This should looks like
-i, --input helppppping
I saw this question, and read this part of the manual, and all seems good but still not formatted well.
I obviously miss something just don't know what.
try this
parser.add_argument('-i', '--input', metavar='', help='helping')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With