fix cmd behaviour for early exit
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c335867935
commit
e06e6f4076
15
cmd/root.go
15
cmd/root.go
@ -33,3 +33,18 @@ func Execute() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// help redefines the original help func, essentially adding a way to exit the
|
||||||
|
// application properly after showing help message
|
||||||
|
func help(*cobra.Command, []string) {
|
||||||
|
err := Root.Usage()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Root.SetHelpFunc(help)
|
||||||
|
}
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// version holds app version string
|
// version holds app version string
|
||||||
var version = "v0.0.12"
|
var version = "v0.0.13"
|
||||||
|
|
||||||
// used to determine whether to print short or long version string
|
// used to determine whether to print short or long version string
|
||||||
var shortVersion = false
|
var shortVersion = false
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
# Generate a user-friendly version number.
|
# Generate a user-friendly version number.
|
||||||
# version = builtins.substring 0 8 lastModifiedDate;
|
# version = builtins.substring 0 8 lastModifiedDate;
|
||||||
version = "v0.0.12";
|
version = "v0.0.13";
|
||||||
|
|
||||||
# System types to support.
|
# System types to support.
|
||||||
supportedSystems =
|
supportedSystems =
|
||||||
|
Loading…
Reference in New Issue
Block a user