Author gotgenes
Recipients gotgenes
Date 2011-01-22.23:01:54
SpamBayes Score 5.00232e-07
Marked as misclassified No
Message-id <1295737320.83.0.942830837874.issue10984@psf.upfronthosting.co.za>
In-reply-to
Content
argparse supports registering conflicting arguments, however, it does so in a way that an argument may belong to at most one group of conflicting arguments. The inspiration for this bug is Stack Overflow question #4770576.
http://stackoverflow.com/questions/4770576/does-argparse-python-support-mutually-exclusive-groups-of-arguments

The most straightforward use case argparse can not accommodate is the following: the user has three flags, '-a', '-b', and '-c'. The flag '-b' is incompatible with both '-a' and with '-c', however, '-a' and '-c' are compatible with each other.

Current practice is to register a conflict by first defining a conflict group with parser.add_mutually_exclusive_group(), and then create new arguments within that group using group.add_argument(). Because the programmer is not allowed to create the argument prior to creating the group, an argument cannot be registered in two exclusive groups.

I feel it would be much more useful to be given the option to create exclusive groups after the programmer has defined and created the options, as is the design for ConflictsOptionParser
http://pypi.python.org/pypi/ConflictsOptionParser/
History
Date User Action Args
2011-01-22 23:02:00gotgenessetrecipients: + gotgenes
2011-01-22 23:02:00gotgenessetmessageid: <1295737320.83.0.942830837874.issue10984@psf.upfronthosting.co.za>
2011-01-22 23:01:55gotgeneslinkissue10984 messages
2011-01-22 23:01:54gotgenescreate