-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add support for arg stability attributes (unstable/deprecated) #3321
Comments
This entails a lot of policy (flag names, whether they should be global or not, user messages, etc). This would both lock us in to specific behavior but also leave a lot of room for it not quite meeting people needs and wanting customization of it. My proposal is we start an example that covers these cases. We then use this to explore how we could improve clap. For example, "require an argument to be present with a value" would go a long way towards a general solution to My hope is we can move clap from a closed-form API to an open-form API where we don't As another example of this open-form API design, yaahc mentioned in a PM wanting this relationship included in a hint in the help, like defaults, envs, and possible values. I had two idea for this
|
As a small clarification on my vague statements, we are looking at not having everything baked directly into |
Now that |
That is an interesting idea to leverage |
Please complete the following tasks
Clap Version
3.0.10
Describe your use case
I had this idea while I was reviewing @sunshowers's CLI recommendations on versioning: https://rust-cli-recommendations.sunshowers.io/versioning.html. In their book they recommend having a stability flag or environment variable for gating new experimental features being exposed in your CLI. This made me think it would be nice if clap provided some support out of the box for managing the stability of various subsets of an App's CLI.
Describe the solution you'd like
I'm imagining two new methods being added to
Arg
I'd expect these flags to also affect the generated help text to somehow deprioritize unstable/deprecated arguments in the generated output and to make it clear that they are not intended for general use.
Alternatives, if applicable
@epage and @sunshowers have both also suggested adding general support for custom settings / attributes so that a feature like this could be experimented with out of tree rather than needing to bake it into clap directly.
Additional Context
No response
The text was updated successfully, but these errors were encountered: