[Python-Dev] PEP 389: argparse - new command line parsing module (original) (raw)
Paul Moore p.f.moore at gmail.com
Wed Sep 30 00:51:23 CEST 2009
- Previous message: [Python-Dev] PEP 389: argparse - new command line parsing module
- Next message: [Python-Dev] PEP 389: argparse - new command line parsing module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2009/9/29 Steven Bethard <steven.bethard at gmail.com>:
If you're not using argparse to write command line applications, then I don't feel bad if you have to do a tiny bit of extra work to take care of that use case. In this particular situation, all you have to do is subclass ArgumentParser and override exit() to do whatever you think it should do. [...] There is only a single method in argparse that prints things, printmessage(). So if you want it to do something else, you can simply override it in a subclass. I can make that method public if this is a common use case.
Thanks, that's fine for me (as things stand, no need to publicly expose and document _print_message).
BTW, the helpful and responsive way you reply to queries is much appreciated.
I'm +1 on the PEP (although I see why people want getopt to stay, so I'm happy to leave that and only deprecate optparse).
Paul.
- Previous message: [Python-Dev] PEP 389: argparse - new command line parsing module
- Next message: [Python-Dev] PEP 389: argparse - new command line parsing module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]