Don't include required arguments in usage strings if they can be passed as an env var #6017
Closed
jcgruenhage
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
This seems the key part for us to both understand to prepare for talking about the feature. The generated man and help will be emphasizing the CLI argument, just like the usage, right? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to load an access token from an environment variable. It's okay if it can be passed as an arg as well, but seeing it in the usage strings is a bit unsettling, because it encourages passing secrets via CLI args.
I definitely want to load the env var using clap, so that I get the error handling from clap and the variable is included in the generated man page and help.
I've seen #5978, and understand that fully layered config with config files + env vars + cli args is not in the near future. I've also seen #4893, which shows behaviour different from what I'm seeing, but in short it says that having them show up in usage strings is expected and unlikely to change.
Can you expand on why this is the case? I'd like to contribute a PR that changes this behaviour, potentially also in a backwards compatible way that requires people explicitly opt-in to the new behaviour if that helps. But I don't want to invest the time if this is a change that isn't wanted upstream.
Beta Was this translation helpful? Give feedback.
All reactions