graphite-project/carbonate

read defaults from environment too?

filippog opened this issue · 2 comments

hi,
I think some defaults for carbonate could be read from the environment too, e.g. the storage paths or the config file location. This would make it easier to e.g. switch to another config for all carbonate tools from the command line or more complex wrappers. If there's interest I'll be happy to submit a PR, what do you think?

thanks,
filippo

Seems reasonable to me. What situations are you hitting where it would be easier to set an envvar rather than pass the value through as a command line arg? The only things in carbonate.conf are cluster specific, so I assume you mean to use envvars to define defaults for things like CONFIG_FILE and CLUSTER.

If the envvars override the CLI defaults, that seems quite logical and would DRY up any wrappers. A PR would be great.

precisely, config file would be the most useful one, basically util.common_parser. I like how concise your README.md examples are and would like to replicate that but with arbitrary config paths. re: overriding yes environment would override CLI default only when used. Minimal PR is #49