aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/flag.go b/flag.go
index 23ef501..362a20a 100644
--- a/flag.go
+++ b/flag.go
@@ -553,10 +553,13 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShor
return
}
var value string
- if bv, ok := flag.Value.(boolFlag); ok && bv.IsBoolFlag() {
+ if len(shorthands) > 2 && shorthands[1] == '=' {
+ value = shorthands[2:]
+ outShorts = ""
+ } else if bv, ok := flag.Value.(boolFlag); ok && bv.IsBoolFlag() {
value = "true"
} else if len(shorthands) > 1 {
- value = strings.TrimPrefix(shorthands[1:], "=")
+ value = shorthands[1:]
outShorts = ""
} else if len(args) > 0 {
value = args[0]