Open giuliohome opened 1 year ago
At first sight, I'd guess the bug is here,
func Execute() error {
return RootCmd.Execute()
}
and the correct way to do that is explained here:
if err := myCommand.Execute(); err != nil {
// There was an error! Print the error message and exit. Or do whatever you'd like!
// This includes errors like "invalid argument" etc.
fmt.Println(err)
os.Exit(1)
}
Describe the bug Show the errors and not the command help if the arguments are missing or correct and the runtime throws.
To Reproduce Steps to reproduce the behavior:
Expected behavior The actual exception should be reported to the output: showing the command arguments help is misleading when there is no usage error in the command line itself!