[Python-Dev] PEP 389: argparse - new command line parsing module (original) (raw)

m h sesquile at gmail.com
Mon Sep 28 20:26:46 CEST 2009


On Mon, Sep 28, 2009 at 9:37 AM, Steven Bethard <steven.bethard at gmail.com> wrote:

On Mon, Sep 28, 2009 at 8:26 AM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:

m h wrote:

Perhaps this is OT, but since command line parsing is part of configuration, I figure I'd throw it out there.  My scripts often have configuration that the command line can override and I loosely follow the example hierarchy[0] listed in The Art of Unix Programming. Some configuration I want in a config file (but I want to override from the command line) and sometimes it's very nice to use environment variables for configuration.  So I do something like this: Integration with command line options is an occasionally-requested feature for ConfigObj. I've always said I would be open to patches... In other words, yes I think there is demand for it. Whether it belongs immediately in the standard library is another matter, but if you wrote a layer that unified ConfigParser and argparse I think you will find that people use it.

Having it integrated with the option parser is ideal. More people will use it if it is in the stdlib. Just like more people will use argparse.

It is well outside the realm of this PEP however. What Michael said. ;-) If you'd like to provide a patch for argparse that provides such functionality, I'd be happy to review it.

Patch submitted [0]. Accidentally marked as "Defect" instead of enhancement. Comments/critiques welcome.

0 - http://code.google.com/p/argparse/issues/detail?id=35&q=label%3AType-Defect

Cheers,

-matt

Steve -- Where did you get that preposterous hypothesis? Did Steve tell you that?  --- The Hiphopopotamus



More information about the Python-Dev mailing list