[argparse] mutually exclusive group with 2 sets of options

Joseph L. Casale jcasale at activenetwerx.com
Mon Aug 5 18:15:47 EDT 2013


> I think you are looking for exclusive groups:
> 
> http://docs.python.org/2.7/library/argparse.html#argparse.add_mutually_excl
> usive_group

No. That links first doc line in that method shows the very point we are all discussing:

"Create a mutually exclusive group. argparse will make sure that only one
of the arguments in the mutually exclusive group was present on the
command line:"

Op requires more than one per group, this method "make sure that only one
of the arguments" is accepted.

jlc


More information about the Python-list mailing list