Re: Issue 35 in argparse: Support for env/config file hierarchy

5 views
Skip to first unread message

argp...@googlecode.com

unread,
Feb 4, 2010, 6:29:02 AM2/4/10
to argpar...@googlegroups.com

Comment #5 on issue 35 by aafshar: Support for env/config file hierarchy
http://code.google.com/p/argparse/issues/detail?id=35

Is this really the correct approach for argparse? My gut instinct is that
argparse
should provide one additional method, something like load_from_dict() which
external
applications will provide data to.

Argparse should absolutely not be involved in calculating these kind of
env/config
hierarchies itself, in my opinion.

I would like to do something like this with sanescript [1], for which I
already use
argparse, but am having some problems, because even while overriding
error()/exit()
control flow is broken, and so I can't then update information from.

I am nto sure if that is the same bug, or a different one

[1] http://bitbucket.org/aafshar/sanescript-main/overview/


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

argp...@googlecode.com

unread,
Jul 23, 2010, 7:44:51 AM7/23/10
to argpar...@googlegroups.com
Updates:
Status: WontFix

Comment #6 on issue 35 by steven.bethard: Support for env/config file
hierarchy
http://code.google.com/p/argparse/issues/detail?id=35

I'm closing this as WontFix because of the lack of consensus. Basically the
proposals were:

* Have add_argument accept some additional parameters to indicate
corresponding config file names and environment variables.

* Add a method like "load_from_dict" that would allow such loading to be
done explicitly.

The former will complicate the already complicated add_argument parameters,
while the latter probably isn't much better than calling set_defaults
before parsing.

Despite the fact that I'm closing this issue, in general I'd like to make
it easier to support something like this. If anyone here would like to make
another suggested API, please file a new bug at bugs.python.org (where
argparse development has moved).

argp...@googlecode.com

unread,
Aug 24, 2014, 9:06:00 PM8/24/14
to argpar...@googlegroups.com

Comment #7 on issue 35 by zorro3.g...@gmail.com: Support for env/config
file hierarchy
https://code.google.com/p/argparse/issues/detail?id=35

The configargparse module (now live on PyPI) extends argparse and adds
support for config files and environment vars using approach #1 in
steven.b's comment.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages