Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: add support for config files #17

Open
konobi opened this issue Mar 1, 2016 · 2 comments
Open

Feature Request: add support for config files #17

konobi opened this issue Mar 1, 2016 · 2 comments

Comments

@konobi
Copy link

konobi commented Mar 1, 2016

It'd be nice if there was support for config files like there is for environment variables. That'd make cmdln the only library I'd need to bootstrap a command line app.

@trentm
Copy link
Owner

trentm commented Mar 2, 2016

Can you elaborate? How would that look in dashdash? What configure file syntax would it specify? I'm slightly skeptical

--Trent

On Mar 1, 2016, at 3:40 PM, Scott McWhirter notifications@github.com wrote:

It'd be nice if there was support for config files like there is for environment variables. That'd make cmdln the only library I'd need to bootstrap a command line app.


Reply to this email directly or view it on GitHub.

@konobi
Copy link
Author

konobi commented Mar 2, 2016

Have a config object that's pre-loaded with a "get" method. Then each place you'd specify an ENV var, you define a string to use with get(). Then the format of the file is of no consequence.

So you'd pass a "config" object into the dashdash constructor, then for each option call get() on the config object with the appropriate string and have the returned value used for defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants