Feature Request: add support for config files
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.
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 [email protected] 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.
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.