commands: Fix typos

This commit is contained in:
Albert 2016-09-12 15:32:11 +06:00 committed by Bjørn Erik Pedersen
parent 3908489ccd
commit f0ac26c944

View file

@ -61,18 +61,18 @@ func Reset() error {
return nil return nil
} }
// userError is an error used to signal different error situations in command handling. // commandError is an error used to signal different error situations in command handling.
type commandError struct { type commandError struct {
s string s string
userError bool userError bool
} }
func (u commandError) Error() string { func (c commandError) Error() string {
return u.s return c.s
} }
func (u commandError) isUserError() bool { func (c commandError) isUserError() bool {
return u.userError return c.userError
} }
func newUserError(a ...interface{}) commandError { func newUserError(a ...interface{}) commandError {
@ -87,7 +87,7 @@ func newSystemErrorF(format string, a ...interface{}) commandError {
return commandError{s: fmt.Sprintf(format, a...), userError: false} return commandError{s: fmt.Sprintf(format, a...), userError: false}
} }
// catch some of the obvious user errors from Cobra. // Catch some of the obvious user errors from Cobra.
// We don't want to show the usage message for every error. // We don't want to show the usage message for every error.
// The below may be to generic. Time will show. // The below may be to generic. Time will show.
var userErrorRegexp = regexp.MustCompile("argument|flag|shorthand") var userErrorRegexp = regexp.MustCompile("argument|flag|shorthand")