You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to call the Execute function on a command so that it will exit with an error? Currently, it just prints the error but does not result in a non-zero exit status for the process. See https://github.com/jessevdk/go-flags/blob/master/parser.go#L198
If you need to discriminate between your errors and those of the flags package, then you can use if _, ok := err.(flags.Error); !ok ...
Otherwise, you can also simply call os.Exit(1) from your Execute handler, nothing wrong with that. Just print the error yourself (flags just does fmt.Fprintln(os.Stderr, err), but checks for the PrintErrors option).
Is there any way to call the Execute function on a command so that it will exit with an error? Currently, it just prints the error but does not result in a non-zero exit status for the process. See https://github.com/jessevdk/go-flags/blob/master/parser.go#L198
Otherwise, is there some way to use the Command interface to get an error back? From the documentation, it would seem that way (https://github.com/jessevdk/go-flags/blob/master/command.go#L21) but I don't think it actually does this.
The text was updated successfully, but these errors were encountered: