Skip to content

Commit a975f4e

Browse files
author
Y.Horie
committed
Fix no need mirror be set --version and --help
1 parent 9338c69 commit a975f4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/root.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ the latest stable version will be downloaded from the repository.`,
7878
return nil
7979
},
8080
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
81+
if len(args) != 0 {
82+
switch args[0] {
83+
case "--help", "-h", "--version", "-v":
84+
return nil
85+
}
86+
}
8187
switch cmd.Name() {
8288
case "init", "rotate", "set":
8389
if cmd.HasParent() && cmd.Parent().Name() == "mirror" {

0 commit comments

Comments
 (0)