Option to avoid leaking sensitive environment variable values in help text #125
-
It is often the case that sensitive details (API keys, cryptographic tokens, etc.) are passed to a program through environment variables, where it is sometimes desirable to pass one-off values for this on the command-line (it's bad to do this a lot because other processes can see it, but it's a useful one-off thing or in a trusted environment). Currently, when using the Perhaps it would be a good idea to add a On another note, I just want to express my appreciation for this crate, it's been wonderful to use. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
There's no ready made hidden |
Beta Was this translation helpful? Give feedback.
-
Thank you! I didn't think of that. |
Beta Was this translation helpful? Give feedback.
-
Now you can write something like this and it won't show up in the help message. fn secret() -> impl Parser<String> {
let secret_env = env("SECRET").argument("SECRET");
let secret_arg = long("secret").help("Secret key, you can also use env variable SECRET").argument("SECRET");
construct!([secret_env, secret_arg])
} |
Beta Was this translation helpful? Give feedback.
Now you can write something like this and it won't show up in the help message.