[issue8538] Add ConfigureAction to argparse

Jeremiah Jordan report at bugs.python.org
Mon Aug 9 23:28:42 CEST 2010


Jeremiah Jordan <jeremiah.jordan at gmail.com> added the comment:

I think this should be updated so that nargs=0 is allowed, so that you can only do --foo/--no-foo and don't clutter up the help/interface with --foo [FOO] --no-foo=[FOO]

You can do this by adding nargs to the ConfigureAction.__init__ and passing that through to super, and then updating __call__ to check 'if value is None or value == []:' instead of the None.

----------
nosy: +Jeremiah.Jordan

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8538>
_______________________________________


More information about the Python-bugs-list mailing list