-
-
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
use -V for version instead of -v #138
Comments
I have added |
@kbknapp honestly, I don't like this change. Many popular cli tools (for example, npm) use the lower case -v for the version short flag. The |
imo
The way to do this in clap today is something like: #[derive(Parser)]
#[command(disable_version_flag = true)]
struct {
/// Print version
#[arg(short = 'v', short_alias = 'V', long, action = clap::builder::ArgAction::Version)]
version: (),
} |
Can we change the version retrieval method to lowercase? Verbose is not something everyone needs, but uppercase input is difficult, using lowercase to obtain the version is more reasonable |
At this point, someone would need to put forward a strong case for changing the default. As shown above, people are free to change this for their application as they wish. |
In order to follow typical conventions where lowercase
-v
is forverbose
and many programs use the capital-V
for version (to includerustc
). Currently, if one wants to use typical-v
for verbose, that leaves only the long forversion
with no option to "add" a short without manually implementing it (which isn't hard...but still).There are two options for this:
-V
which is a "breaking" change (at least for downstream documentation).-v
for version unless manually overridden, then use short-V
if available.I like option 2 because it's a non-breaking change, the downside is it could be confusing if a program suddenly changes from
-v
to-V
for version seemingly automagically. Or when subcommands have one-v
but parents or other subcommands have-V
....so maybe I actually prefer option 1.TBD
The text was updated successfully, but these errors were encountered: