Hacker News new | past | comments | ask | show | jobs | submit login

I don't remember seeing this explicitly stated anywhere, but based on stuff I've read, I think there is loose / informal Unix convention that some command-line programs follow, about how they can be configured at runtime:

- command line options override environment variables, which in turn override config files (meaning applied to all three, for the same config setting).

I thought this was a good idea and can lead to flexibility, though also some complexity.

I think this might be a good scenario for the use of those three methods of configuration:

- config file settings for common values for options, or values that rarely change. So you set them to those values and change them rarely, when you need to make the new values permanent for a while.

- env. var settings for say, a session of work - in that session you want to override the config file value, and use it for (most of) the duration of your work session

- command-line options to override either of the previous two, say for just a command invocation or two (setting will automatically then revert to either of the two previous methods's values).

Interested to know if others have noticed this pattern (or think it is one) and any comments, since as I said, I don't remember seeing it written down anywhere.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: