Skip to content

Commit

Permalink
feat: add lowercase -v version flag (#23750)
Browse files Browse the repository at this point in the history
Ref #5289
  • Loading branch information
dsherret authored May 23, 2024
1 parent 4908d45 commit f5d0c4b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
9 changes: 9 additions & 0 deletions cli/args/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,15 @@ fn clap_root() -> Command {
.long_version(long_version)
// cause --unstable flags to display at the bottom of the help text
.next_display_order(1000)
.disable_version_flag(true)
.arg(
Arg::new("version")
.short('V')
.short_alias('v')
.long("version")
.action(ArgAction::Version)
.help("Print version")
)
.arg(
Arg::new("unstable")
.long("unstable")
Expand Down
21 changes: 14 additions & 7 deletions tests/specs/flags/version_flag/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"steps": [{
"args": "-V",
"output": "[WILDCARD]"
}, {
"args": "--version",
"output": "[WILDCARD]"
}]
"tests": {
"uppercase_v": {
"args": "-V",
"output": "[WILDCARD]"
},
"lowercase_v": {
"args": "-v",
"output": "[WILDCARD]"
},
"long_version": {
"args": "--version",
"output": "[WILDCARD]"
}
}
}

0 comments on commit f5d0c4b

Please sign in to comment.