diff options
Diffstat (limited to 'err.go')
-rw-r--r-- | err.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -2,14 +2,18 @@ package opts import "fmt" -type ErrBadOption rune +// A BadOptionError describes an option that the user attempted to pass +// which the developer did not register. +type BadOptionError rune -func (e ErrBadOption) Error() string { +func (e BadOptionError) Error() string { return fmt.Sprintf("unknown option ā%cā", e) } -type ErrNoArgument rune +// A NoArgumentError describes an option that the user attempted to pass +// without an argument, which required an argument. +type NoArgumentError rune -func (e ErrNoArgument) Error() string { +func (e NoArgumentError) Error() string { return fmt.Sprintf("expected argument for option ā%cā", e) } |