aboutsummaryrefslogtreecommitdiff
path: root/err.go
diff options
context:
space:
mode:
Diffstat (limited to 'err.go')
-rw-r--r--err.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/err.go b/err.go
index b964c11..cbe96b4 100644
--- a/err.go
+++ b/err.go
@@ -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)
}