aboutsummaryrefslogtreecommitdiff
path: root/flag_test.go
diff options
context:
space:
mode:
authorCharlie R.C <[email protected]>2017-05-05 00:19:47 -0500
committerAlbert Nigmatzianov <[email protected]>2017-05-05 07:19:47 +0200
commita84f757ed2ae26fca9fdb8d84d6fffa605b63fae (patch)
tree24dfd1ef767c8c1b058b6928b53f2c466a89ba02 /flag_test.go
parentc990990ab4981d84da820b7b00c85139ca150b5f (diff)
Allow lookup by shorthand (#106)
Diffstat (limited to 'flag_test.go')
-rw-r--r--flag_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/flag_test.go b/flag_test.go
index 172d49f..8248277 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -936,6 +936,7 @@ const defaultOutput = ` --A for bootstrapping, allo
--Alongflagname disable bounds checking
-C, --CCC a boolean defaulting to true (default true)
--D path set relative path for local imports
+ -E, --EEE num[=1234] a num with NoOptDefVal (default 4321)
--F number a non-zero number (default 2.7)
--G float a float that defaults to zero
--IP ip IP address with no default
@@ -987,6 +988,8 @@ func TestPrintDefaults(t *testing.T) {
fs.Lookup("ND1").NoOptDefVal = "bar"
fs.Int("ND2", 1234, "a `num` with NoOptDefVal")
fs.Lookup("ND2").NoOptDefVal = "4321"
+ fs.IntP("EEE", "E", 4321, "a `num` with NoOptDefVal")
+ fs.ShorthandLookup("E").NoOptDefVal = "1234"
fs.StringSlice("StringSlice", []string{}, "string slice with zero default")
fs.StringArray("StringArray", []string{}, "string array with zero default")