4 ms·
I would go one step further and say that all sources of runtime configuration should be reportable: * Config files * CLI options * Environment variables And
by runeks 3y ago
I would go one step further and say that all sources of runtime configuration should be reportable:
* Config files
* CLI options
* Environment variables
And what takes precedence when.
- bbkane 3y agoI try to write all my CLIs this way - to the point of writing my own Go CLI parsing library [0] to do it. Now, when I run `cmd -h`, I get output like the following for all flags (example from [1]): --count , -c : Number of times to dig type : int default : 1 configpath : dig.combine.count required : true currentvalue (set by config) : 1 It's sometimes more verbose than I'd like, but it's quite useful for figuring out how a flag got its current value [0] https://github.com/bbkane/warg https://github.com/bbkane/warg [1] https://github.com/bbkane/shovel https://github.com/bbkane/shovel
- nmz 3y agothis would also really help the CLI in terms of auto completion, I see people go above and beyond writing completion scripts, which could be simplified instead by running --autocomplete or checking some file somewhere.