Skip to content

Option to avoid leaking sensitive environment variable values in help text #125

Answered by pacak
infomorphic-matti asked this question in Q&A
Discussion options

You must be logged in to vote

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])
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pacak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #124 on November 13, 2022 20:09.