paul j3 added the comment:

Another approach would be make the 'argparse' argument a 'switch' command, and 
act on it after parsing.  Roughly what I have in mind is:

    parser.add_argument('--verbosity', dest='switch_verbosity, 
action='store_true', help='....'%config_defaults['verbose'])
    ....
    args = parser.parse_args()

    verbosity = config_defaults['verbose']
    if args.switch_verbosity:
       verbosity = not verbosity

In other words, you don't need to do all of the manipulation of values in 
'argparse' itself.  Its primary purpose is to decipher what the user wants, and 
secondarily to guide him (with help, error messages, etc).

----------
nosy: +paul.j3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21805>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to