New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
derive error for missing = value
for attributes is confusing
#3726
Comments
Include it for feature parity with twine's `TWINE_USERNAME`. Refactor `MATURIN_PASSWORD` variable handling: note that `clap` attributes can not be used until <clap-rs/clap#3726> is resolved.
Boolean builder functions do not have an implied #[clap(short, long, env = "PROGRAM_PASSWORD", hide_env_values = true)]
password: Option<String>, See #3620 |
Thanks! I should've tried that before opening an issue 😮💨 I was getting
when compiling, and it is not mentioned anywhere in the documentation, so I just assumed that this attribute was not implemented. |
Thats an artifact of how we parse the attributes. It isn't in our hard coded list of attributes that work without a |
hide_env_values()
can't be used via the Derive API= value
for attributes is confusing
Would you be opposed to adding the boolean attributes to the list that are accepted without a value? I imagine they all could be treated as true, but I would go through them and check. (To be clear, I’m volunteering.) Otherwise, I suppose the error could be something like:
I‘m not sure how much clearer that is, though. |
@danielparks see #3620 |
Please complete the following tasks
Clap Version
3.1.18
Describe your use case
I'm trying to add an environment variable fallback for the
--password
option. I do not want the variable value to be accidentally revealed when--help
is used.I tried to write
but the error made me think that the attribute doesn't exist when it does:
(Note: #3620 is for bool shorthand support)
Describe the solution you'd like
A clearer error message
Alternatives, if applicable
Additional Context
No response
The text was updated successfully, but these errors were encountered: