On 2009-09-28 10:37 AM, Steven Bethard 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. >> >> 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. cfgparse appears to fill this role for optparse. It might be straightforward to port it to argparse. http://cfgparse.sourceforge.net/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4