Using argparse
in relation to Python dependencies between groups using argparse, I have an argument part of some parser group of a parser - for example:
group_simulate.add_argument('-P',
help='simulate FC port down',
nargs=1,
metavar='fc_port_name',
dest='simulate')
How it's possible to use the choices to limit the choices to a list of parameters of the next structure:
1:m:"number between 1 and 10":p:"number between 1 and 4"
I have tried to use the range option but I couldn't find a way to create a list of choices that are acceptable
examples: legal parameters:
test.py -P 1:m:4:p:2
not legal parameters:
test.py -P 1:p:2
test.py -P abvds
Thank you very much for the help guys!