aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/flag.go b/flag.go
index 0519465..6f1fc30 100644
--- a/flag.go
+++ b/flag.go
@@ -327,7 +327,9 @@ func (f *FlagSet) ShorthandLookup(name string) *Flag {
return nil
}
if len(name) > 1 {
- panic("can't look up for a shorthand with name more than one character")
+ msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name)
+ fmt.Fprintf(f.out(), msg)
+ panic(msg)
}
c := name[0]
return f.shorthands[c]