[argparse] mutually exclusive group with 2 sets of options

Miki Tebeka miki.tebeka at gmail.com
Mon Aug 5 10:11:01 EDT 2013


> Is it possible with argparse to have this syntax for a script?
> my-script (-a -b VALUE-B | -c -d VALUE-D)
> 
> I would like to do this with the argparse module.
You can probably do something similar using sub commands (http://docs.python.org/2/library/argparse.html#sub-commands).



More information about the Python-list mailing list