Re:Conventions for Command Line Options
by boring_twenties on Saturday August 01, 2020 @09:06PM
(#24025429)
> It's also hard to inspect; the output of "env" tends to be somewhat long, and you don't know which the program will pick up on. Flags are much clearer and more explicit.
I don't think I disagree with your post, but this particular point seems to be trivially solved by prefixing the variable name with the program name?
IOW: `env | grep '^GIT_'` to see what you're passing to `git`.
There's also the issue that typo'ing "foo" as "fooo" will silently fail. Okay, that's a simple example, but some tools have "PROGRAMNAME_LONGDESCRIPTION". Being in all-caps also makes it hard to spot typos for me. You generally want your env vars to be long, so ensure they're unique.