Validating Command Line Options

Boris FELD lothiraldan at gmail.com
Wed Mar 23 10:50:15 EDT 2011


If you're using argparse, you have a method for that named
"add_mutually_exclusive_group". Tutorial :
http://www.doughellmann.com/PyMOTW/argparse/#mutually-exclusive-options

Cheers,
Feld Boris

2011/3/23 T <misceverything at gmail.com>:
> For a Python script with multiple command line options, what is the
> best way to go about validating that only certain options are used
> together?  For example, say -s, -t, and -v are all valid options, but
> should never be used together (i.e. -s -t would be invalid).  Thanks
> in advance.
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list