Skip to content

Commit

Permalink
main: make "-v" flag to also skip init code
Browse files Browse the repository at this point in the history
"-v" is the short version of "--version", and due to our passthrough
feature with git it wasn't being handled.

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
  • Loading branch information
bmeneg committed Mar 28, 2021
1 parent 7960f84 commit 1e61f40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func Execute() {
if cmd.Use == RootCmd.Use && len(os.Args) > 1 {
var knownFlag bool
for _, v := range os.Args {
if v == "-h" || v == "--help" || v == "--version" {
if v == "-h" || v == "--help" || v == "--version" || v == "-v" {
knownFlag = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func skipInit() bool {
return true
}
switch os.Args[1] {
case "--version", "version":
case "-v", "--version", "version":
return true
case "-h", "--help", "help":
return true
Expand Down

0 comments on commit 1e61f40

Please sign in to comment.