-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Hidden possible values #3061
Comments
You're in luck; we already support this! This is a reported earlier in #2756 which was fixed in #2756 and #2762. It went through some iteration since then, so for a recent example, see https://docs.rs/clap/3.0.0-beta.5/clap/struct.Arg.html#method.possible_values |
Oh, I'm sorry to have missed this both in the docs and in the issue tracker 😕 But awesome that it's already supported! |
btw is there a reason you are using Also, an alias (which shouldn't be visible) should also work in your case. |
@epage yeah, we have a custom |
Hmm.. I think it does. IIRC we tried to allow it work with that trait. But maybe the code changed? |
Well, the custom |
Please complete the following tasks
Clap Version
3.0.0-beta.5
Describe your use case
In tealdeer a user can override the platform / OS by using the
--platform=(linux|osx|sunos|windows)
flag. This is how we implement the parameter:In the next version, we will probably rename
osx
tomacos
but keeposx
for backwards compatibility. However, this means both options will be listed in the--help
docs and in auto-generated completion files. To the end user, this may be confusing.Describe the solution you'd like
It would be nice if I could specify
hidden_possible_values
that are accepted, but not listed in docs and completions.Alternatives, if applicable
Alternatively I could specify
.hide_possible_values(true)
and include the possible values in the help text, but then the value still shows up in the completion, which might confuse the user ("what's the difference between macos and osx?").Additional Context
No response
The text was updated successfully, but these errors were encountered: