diff options
| author | Albert Nigmatzianov <[email protected]> | 2017-04-19 14:27:09 +0200 |
|---|---|---|
| committer | Albert Nigmatzianov <[email protected]> | 2017-04-26 21:20:41 +0200 |
| commit | 9c8891d278271e84769ed47a1f769336291c02b8 (patch) | |
| tree | 6416caf7da0ac39c6d143e1a223f52c51b25cc63 /flag.go | |
| parent | 1d9fab458082a6f06834b844d331fb039a6821b3 (diff) | |
Add more verbosity to panic of shorthand redefinition
See https://github.com/spf13/cobra/issues/27#issuecomment-294690084
Diffstat (limited to 'flag.go')
| -rw-r--r-- | flag.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -793,7 +793,7 @@ func (f *FlagSet) AddFlag(flag *Flag) { old, alreadyThere := f.shorthands[c] if alreadyThere { fmt.Fprintf(f.out(), "%s shorthand reused: %q for %s already used for %s\n", f.name, c, flag.Name, old.Name) - panic("shorthand redefinition") + panic(fmt.Sprintf("unable to redefine %q shorthand", c)) } f.shorthands[c] = flag } |
