aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorEric Paris <[email protected]>2015-04-27 15:26:07 -0500
committerEric Paris <[email protected]>2015-04-27 15:26:07 -0500
commit5a5d661298302ebb7bf7fb205a37a566b0de94d7 (patch)
tree33d6263efa5dc8b75a2434af658e3117402792bc /flag.go
parent08b1790a84badfb786d0cb0a60d6849630fc0d09 (diff)
parentf21662750abbd76e54f307765b0986b357ed8b92 (diff)
Merge pull request #12 from fabianofranz/master
Add support to short form with equal sign: -p=value
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/flag.go b/flag.go
index 5f14635..7fb0990 100644
--- a/flag.go
+++ b/flag.go
@@ -527,7 +527,8 @@ func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error)
continue
}
if i < len(shorthands)-1 {
- if e := f.setFlag(flag, shorthands[i+1:], s); e != nil {
+ v := strings.TrimPrefix(shorthands[i+1:], "=")
+ if e := f.setFlag(flag, v, s); e != nil {
err = e
return
}