From a84f757ed2ae26fca9fdb8d84d6fffa605b63fae Mon Sep 17 00:00:00 2001 From: "Charlie R.C" Date: Fri, 5 May 2017 00:19:47 -0500 Subject: Allow lookup by shorthand (#106) --- flag_test.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'flag_test.go') 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") -- cgit v1.2.3