func handleCommandError(c Command, ctx *Context, err error, f *gnuflag.FlagSet) (rc int, done bool) {
	switch err {
	case nil:
		return 0, false
	case gnuflag.ErrHelp:
		ctx.Stdout.Write(c.Info().Help(f))
		return 0, true
	case ErrSilent:
		return 2, true
	default:
		WriteError(ctx.Stderr, err)
		return 2, true
	}
}
// Errors from commands can be ErrSilent (don't print an error message),
// ErrHelp (show the help) or some other error related to needed flags
// missing, or needed positional args missing, in which case we should
// print the error and return a non-zero return code.
Errors from commands can be ErrSilent (don't print an error message),
ErrHelp (show the help) or some other error related to needed flags
missing, or needed positional args missing, in which case we should
print the error and return a non-zero return code.
// Errors from commands can be ErrSilent ( don ' t print an error message ) // ErrHelp ( show the help ) or some other error related to needed flags // missing or needed positional args missing in which case we should // print the error and return a non - zero return code .
func handleCommandError(c Command, ctx *Context, err error, f *gnuflag.FlagSet) (rc int, done bool) {
	switch err {
	case nil:
		return 0, false
	case gnuflag.ErrHelp:
		ctx.Stdout.Write(c.Info().Help(f))
		return 0, true
	case ErrSilent:
		return 2, true
	default:
		WriteError(ctx.Stderr, err)
		return 2, true
	}
}
func handleCommandError ( c Command , ctx * Context , err error , f * gnuflag . FlagSet ) ( rc int , done bool ) { switch err { case nil : return 0 , false case gnuflag . ErrHelp : ctx . Stdout . Write ( c . Info ( ) . Help ( f ) ) return 0 , true case ErrSilent : return 2 , true default : WriteError ( ctx . Stderr , err ) return 2 , true } }
Errors from commands can be ErrSilent (don't print an error message),
ErrHelp (show the help) or some other error related to needed flags
missing, or needed positional args missing, in which case we should
print the error and return a non-zero return code.
Errors from commands can be ErrSilent ( don ' t print an error message ) ErrHelp ( show the help ) or some other error related to needed flags missing or needed positional args missing in which case we should print the error and return a non - zero return code .