diff options
| -rw-r--r-- | bool.go | 8 | ||||
| -rw-r--r-- | duration.go | 8 | ||||
| -rw-r--r-- | export_test.go | 6 | ||||
| -rw-r--r-- | flag.go | 38 | ||||
| -rw-r--r-- | flag_test.go | 6 | ||||
| -rw-r--r-- | float32.go | 8 | ||||
| -rw-r--r-- | float64.go | 8 | ||||
| -rw-r--r-- | int.go | 8 | ||||
| -rw-r--r-- | int32.go | 8 | ||||
| -rw-r--r-- | int64.go | 8 | ||||
| -rw-r--r-- | int8.go | 8 | ||||
| -rw-r--r-- | ip.go | 8 | ||||
| -rw-r--r-- | ipmask.go | 8 | ||||
| -rw-r--r-- | string.go | 8 | ||||
| -rw-r--r-- | uint.go | 8 | ||||
| -rw-r--r-- | uint16.go | 8 | ||||
| -rw-r--r-- | uint32.go | 8 | ||||
| -rw-r--r-- | uint64.go | 8 | ||||
| -rw-r--r-- | uint8.go | 8 |
19 files changed, 89 insertions, 89 deletions
@@ -35,12 +35,12 @@ func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage st // BoolVar defines a bool flag with specified name, default value, and usage string. // The argument p points to a bool variable in which to store the value of the flag. func BoolVar(p *bool, name string, value bool, usage string) { - commandLine.VarP(newBoolValue(value, p), name, "", usage) + CommandLine.VarP(newBoolValue(value, p), name, "", usage) } // Like BoolVar, but accepts a shorthand letter that can be used after a single dash. func BoolVarP(p *bool, name, shorthand string, value bool, usage string) { - commandLine.VarP(newBoolValue(value, p), name, shorthand, usage) + CommandLine.VarP(newBoolValue(value, p), name, shorthand, usage) } // Bool defines a bool flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool // Bool defines a bool flag with specified name, default value, and usage string. // The return value is the address of a bool variable that stores the value of the flag. func Bool(name string, value bool, usage string) *bool { - return commandLine.BoolP(name, "", value, usage) + return CommandLine.BoolP(name, "", value, usage) } // Like Bool, but accepts a shorthand letter that can be used after a single dash. func BoolP(name, shorthand string, value bool, usage string) *bool { - return commandLine.BoolP(name, shorthand, value, usage) + return CommandLine.BoolP(name, shorthand, value, usage) } diff --git a/duration.go b/duration.go index d885f7c..db59463 100644 --- a/duration.go +++ b/duration.go @@ -39,12 +39,12 @@ func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value t // DurationVar defines a time.Duration flag with specified name, default value, and usage string. // The argument p points to a time.Duration variable in which to store the value of the flag. func DurationVar(p *time.Duration, name string, value time.Duration, usage string) { - commandLine.VarP(newDurationValue(value, p), name, "", usage) + CommandLine.VarP(newDurationValue(value, p), name, "", usage) } // Like DurationVar, but accepts a shorthand letter that can be used after a single dash. func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) { - commandLine.VarP(newDurationValue(value, p), name, shorthand, usage) + CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage) } // Duration defines a time.Duration flag with specified name, default value, and usage string. @@ -65,10 +65,10 @@ func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage s // Duration defines a time.Duration flag with specified name, default value, and usage string. // The return value is the address of a time.Duration variable that stores the value of the flag. func Duration(name string, value time.Duration, usage string) *time.Duration { - return commandLine.DurationP(name, "", value, usage) + return CommandLine.DurationP(name, "", value, usage) } // Like Duration, but accepts a shorthand letter that can be used after a single dash. func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { - return commandLine.DurationP(name, shorthand, value, usage) + return CommandLine.DurationP(name, shorthand, value, usage) } diff --git a/export_test.go b/export_test.go index 8c74635..92c6b54 100644 --- a/export_test.go +++ b/export_test.go @@ -15,7 +15,7 @@ import ( // After calling ResetForTesting, parse errors in flag handling will not // exit the program. func ResetForTesting(usage func()) { - commandLine = &FlagSet{ + CommandLine = &FlagSet{ name: os.Args[0], errorHandling: ContinueOnError, output: ioutil.Discard, @@ -24,6 +24,6 @@ func ResetForTesting(usage func()) { } // CommandLine returns the default FlagSet. -func CommandLine() *FlagSet { - return commandLine +func GetCommandLine() *FlagSet { + return CommandLine } @@ -187,7 +187,7 @@ func (f *FlagSet) VisitAll(fn func(*Flag)) { // VisitAll visits the command-line flags in lexicographical order, calling // fn for each. It visits all flags, even those not set. func VisitAll(fn func(*Flag)) { - commandLine.VisitAll(fn) + CommandLine.VisitAll(fn) } // Visit visits the flags in lexicographical order, calling fn for each. @@ -201,7 +201,7 @@ func (f *FlagSet) Visit(fn func(*Flag)) { // Visit visits the command-line flags in lexicographical order, calling fn // for each. It visits only those flags that have been set. func Visit(fn func(*Flag)) { - commandLine.Visit(fn) + CommandLine.Visit(fn) } // Lookup returns the Flag structure of the named flag, returning nil if none exists. @@ -212,7 +212,7 @@ func (f *FlagSet) Lookup(name string) *Flag { // Lookup returns the Flag structure of the named command-line flag, // returning nil if none exists. func Lookup(name string) *Flag { - return commandLine.formal[name] + return CommandLine.formal[name] } // Set sets the value of the named flag. @@ -234,7 +234,7 @@ func (f *FlagSet) Set(name, value string) error { // Set sets the value of the named command-line flag. func Set(name, value string) error { - return commandLine.Set(name, value) + return CommandLine.Set(name, value) } // PrintDefaults prints, to standard error unless configured @@ -257,7 +257,7 @@ func (f *FlagSet) PrintDefaults() { // PrintDefaults prints to standard error the default values of all defined command-line flags. func PrintDefaults() { - commandLine.PrintDefaults() + CommandLine.PrintDefaults() } // defaultUsage is the default function to print a usage message. @@ -266,7 +266,7 @@ func defaultUsage(f *FlagSet) { f.PrintDefaults() } -// NOTE: Usage is not just defaultUsage(commandLine) +// NOTE: Usage is not just defaultUsage(CommandLine) // because it serves (via godoc flag Usage) as the example // for how to write your own usage function. @@ -281,7 +281,7 @@ var Usage = func() { func (f *FlagSet) NFlag() int { return len(f.actual) } // NFlag returns the number of command-line flags that have been set. -func NFlag() int { return len(commandLine.actual) } +func NFlag() int { return len(CommandLine.actual) } // Arg returns the i'th argument. Arg(0) is the first remaining argument // after flags have been processed. @@ -295,20 +295,20 @@ func (f *FlagSet) Arg(i int) string { // Arg returns the i'th command-line argument. Arg(0) is the first remaining argument // after flags have been processed. func Arg(i int) string { - return commandLine.Arg(i) + return CommandLine.Arg(i) } // NArg is the number of arguments remaining after flags have been processed. func (f *FlagSet) NArg() int { return len(f.args) } // NArg is the number of arguments remaining after flags have been processed. -func NArg() int { return len(commandLine.args) } +func NArg() int { return len(CommandLine.args) } // Args returns the non-flag arguments. func (f *FlagSet) Args() []string { return f.args } // Args returns the non-flag command-line arguments. -func Args() []string { return commandLine.args } +func Args() []string { return CommandLine.args } // Var defines a flag with the specified name and usage string. The type and // value of the flag are represented by the first argument, of type Value, which @@ -361,12 +361,12 @@ func (f *FlagSet) VarP(value Value, name, shorthand, usage string) { // of strings by giving the slice the methods of Value; in particular, Set would // decompose the comma-separated string into the slice. func Var(value Value, name string, usage string) { - commandLine.VarP(value, name, "", usage) + CommandLine.VarP(value, name, "", usage) } // Like Var, but accepts a shorthand letter that can be used after a single dash. func VarP(value Value, name, shorthand, usage string) { - commandLine.VarP(value, name, shorthand, usage) + CommandLine.VarP(value, name, shorthand, usage) } // failf prints to standard error a formatted error and usage message and @@ -379,9 +379,9 @@ func (f *FlagSet) failf(format string, a ...interface{}) error { } // usage calls the Usage method for the flag set, or the usage function if -// the flag set is commandLine. +// the flag set is CommandLine. func (f *FlagSet) usage() { - if f == commandLine { + if f == CommandLine { Usage() } else if f.Usage == nil { defaultUsage(f) @@ -512,22 +512,22 @@ func (f *FlagSet) Parsed() bool { // Parse parses the command-line flags from os.Args[1:]. Must be called // after all flags are defined and before flags are accessed by the program. func Parse() { - // Ignore errors; commandLine is set for ExitOnError. - commandLine.Parse(os.Args[1:]) + // Ignore errors; CommandLine is set for ExitOnError. + CommandLine.Parse(os.Args[1:]) } // Whether to support interspersed option/non-option arguments. func SetInterspersed(interspersed bool) { - commandLine.SetInterspersed(interspersed) + CommandLine.SetInterspersed(interspersed) } // Parsed returns true if the command-line flags have been parsed. func Parsed() bool { - return commandLine.Parsed() + return CommandLine.Parsed() } // The default set of command-line flags, parsed from os.Args. -var commandLine = NewFlagSet(os.Args[0], ExitOnError) +var CommandLine = NewFlagSet(os.Args[0], ExitOnError) // NewFlagSet returns a new, empty flag set with the specified name and // error handling property. diff --git a/flag_test.go b/flag_test.go index 42d5483..aa8682f 100644 --- a/flag_test.go +++ b/flag_test.go @@ -97,7 +97,7 @@ func TestEverything(t *testing.T) { func TestUsage(t *testing.T) { called := false ResetForTesting(func() { called = true }) - if CommandLine().Parse([]string{"--x"}) == nil { + if GetCommandLine().Parse([]string{"--x"}) == nil { t.Error("parse did not fail for unknown flag") } if !called { @@ -224,7 +224,7 @@ func TestShorthand(t *testing.T) { func TestParse(t *testing.T) { ResetForTesting(func() { t.Error("bad parse") }) - testParse(CommandLine(), t) + testParse(GetCommandLine(), t) } func TestFlagSetParse(t *testing.T) { @@ -279,7 +279,7 @@ func TestChangingArgs(t *testing.T) { defer func() { os.Args = oldArgs }() os.Args = []string{"cmd", "--before", "subcmd"} before := Bool("before", false, "") - if err := CommandLine().Parse(os.Args[1:]); err != nil { + if err := GetCommandLine().Parse(os.Args[1:]); err != nil { t.Fatal(err) } cmd := Arg(0) @@ -35,12 +35,12 @@ func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, // Float32Var defines a float32 flag with specified name, default value, and usage string. // The argument p points to a float32 variable in which to store the value of the flag. func Float32Var(p *float32, name string, value float32, usage string) { - commandLine.VarP(newFloat32Value(value, p), name, "", usage) + CommandLine.VarP(newFloat32Value(value, p), name, "", usage) } // Like Float32Var, but accepts a shorthand letter that can be used after a single dash. func Float32VarP(p *float32, name, shorthand string, value float32, usage string) { - commandLine.VarP(newFloat32Value(value, p), name, shorthand, usage) + CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage) } // Float32 defines a float32 flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) // Float32 defines a float32 flag with specified name, default value, and usage string. // The return value is the address of a float32 variable that stores the value of the flag. func Float32(name string, value float32, usage string) *float32 { - return commandLine.Float32P(name, "", value, usage) + return CommandLine.Float32P(name, "", value, usage) } // Like Float32, but accepts a shorthand letter that can be used after a single dash. func Float32P(name, shorthand string, value float32, usage string) *float32 { - return commandLine.Float32P(name, shorthand, value, usage) + return CommandLine.Float32P(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, // Float64Var defines a float64 flag with specified name, default value, and usage string. // The argument p points to a float64 variable in which to store the value of the flag. func Float64Var(p *float64, name string, value float64, usage string) { - commandLine.VarP(newFloat64Value(value, p), name, "", usage) + CommandLine.VarP(newFloat64Value(value, p), name, "", usage) } // Like Float64Var, but accepts a shorthand letter that can be used after a single dash. func Float64VarP(p *float64, name, shorthand string, value float64, usage string) { - commandLine.VarP(newFloat64Value(value, p), name, shorthand, usage) + CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage) } // Float64 defines a float64 flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) // Float64 defines a float64 flag with specified name, default value, and usage string. // The return value is the address of a float64 variable that stores the value of the flag. func Float64(name string, value float64, usage string) *float64 { - return commandLine.Float64P(name, "", value, usage) + return CommandLine.Float64P(name, "", value, usage) } // Like Float64, but accepts a shorthand letter that can be used after a single dash. func Float64P(name, shorthand string, value float64, usage string) *float64 { - return commandLine.Float64P(name, shorthand, value, usage) + return CommandLine.Float64P(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage strin // IntVar defines an int flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. func IntVar(p *int, name string, value int, usage string) { - commandLine.VarP(newIntValue(value, p), name, "", usage) + CommandLine.VarP(newIntValue(value, p), name, "", usage) } // Like IntVar, but accepts a shorthand letter that can be used after a single dash. func IntVarP(p *int, name, shorthand string, value int, usage string) { - commandLine.VarP(newIntValue(value, p), name, shorthand, usage) + CommandLine.VarP(newIntValue(value, p), name, shorthand, usage) } // Int defines an int flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int { // Int defines an int flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. func Int(name string, value int, usage string) *int { - return commandLine.IntP(name, "", value, usage) + return CommandLine.IntP(name, "", value, usage) } // Like Int, but accepts a shorthand letter that can be used after a single dash. func IntP(name, shorthand string, value int, usage string) *int { - return commandLine.IntP(name, shorthand, value, usage) + return CommandLine.IntP(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage // Int32Var defines an int32 flag with specified name, default value, and usage string. // The argument p points to an int32 variable in which to store the value of the flag. func Int32Var(p *int32, name string, value int32, usage string) { - commandLine.VarP(newInt32Value(value, p), name, "", usage) + CommandLine.VarP(newInt32Value(value, p), name, "", usage) } // Like Int32Var, but accepts a shorthand letter that can be used after a single dash. func Int32VarP(p *int32, name, shorthand string, value int32, usage string) { - commandLine.VarP(newInt32Value(value, p), name, shorthand, usage) + CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage) } // Int32 defines an int32 flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int // Int32 defines an int32 flag with specified name, default value, and usage string. // The return value is the address of an int32 variable that stores the value of the flag. func Int32(name string, value int32, usage string) *int32 { - return commandLine.Int32P(name, "", value, usage) + return CommandLine.Int32P(name, "", value, usage) } // Like Int32, but accepts a shorthand letter that can be used after a single dash. func Int32P(name, shorthand string, value int32, usage string) *int32 { - return commandLine.Int32P(name, shorthand, value, usage) + return CommandLine.Int32P(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage // Int64Var defines an int64 flag with specified name, default value, and usage string. // The argument p points to an int64 variable in which to store the value of the flag. func Int64Var(p *int64, name string, value int64, usage string) { - commandLine.VarP(newInt64Value(value, p), name, "", usage) + CommandLine.VarP(newInt64Value(value, p), name, "", usage) } // Like Int64Var, but accepts a shorthand letter that can be used after a single dash. func Int64VarP(p *int64, name, shorthand string, value int64, usage string) { - commandLine.VarP(newInt64Value(value, p), name, shorthand, usage) + CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage) } // Int64 defines an int64 flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int // Int64 defines an int64 flag with specified name, default value, and usage string. // The return value is the address of an int64 variable that stores the value of the flag. func Int64(name string, value int64, usage string) *int64 { - return commandLine.Int64P(name, "", value, usage) + return CommandLine.Int64P(name, "", value, usage) } // Like Int64, but accepts a shorthand letter that can be used after a single dash. func Int64P(name, shorthand string, value int64, usage string) *int64 { - return commandLine.Int64P(name, shorthand, value, usage) + return CommandLine.Int64P(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage st // Int8Var defines an int8 flag with specified name, default value, and usage string. // The argument p points to an int8 variable in which to store the value of the flag. func Int8Var(p *int8, name string, value int8, usage string) { - commandLine.VarP(newInt8Value(value, p), name, "", usage) + CommandLine.VarP(newInt8Value(value, p), name, "", usage) } // Like Int8Var, but accepts a shorthand letter that can be used after a single dash. func Int8VarP(p *int8, name, shorthand string, value int8, usage string) { - commandLine.VarP(newInt8Value(value, p), name, shorthand, usage) + CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage) } // Int8 defines an int8 flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 // Int8 defines an int8 flag with specified name, default value, and usage string. // The return value is the address of an int8 variable that stores the value of the flag. func Int8(name string, value int8, usage string) *int8 { - return commandLine.Int8P(name, "", value, usage) + return CommandLine.Int8P(name, "", value, usage) } // Like Int8, but accepts a shorthand letter that can be used after a single dash. func Int8P(name, shorthand string, value int8, usage string) *int8 { - return commandLine.Int8P(name, shorthand, value, usage) + return CommandLine.Int8P(name, shorthand, value, usage) } @@ -40,12 +40,12 @@ func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage // IPVar defines an net.IP flag with specified name, default value, and usage string. // The argument p points to an net.IP variable in which to store the value of the flag. func IPVar(p *net.IP, name string, value net.IP, usage string) { - commandLine.VarP(newIPValue(value, p), name, "", usage) + CommandLine.VarP(newIPValue(value, p), name, "", usage) } // Like IPVar, but accepts a shorthand letter that can be used after a single dash. func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) { - commandLine.VarP(newIPValue(value, p), name, shorthand, usage) + CommandLine.VarP(newIPValue(value, p), name, shorthand, usage) } // IP defines an net.IP flag with specified name, default value, and usage string. @@ -66,10 +66,10 @@ func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.I // IP defines an net.IP flag with specified name, default value, and usage string. // The return value is the address of an net.IP variable that stores the value of the flag. func IP(name string, value net.IP, usage string) *net.IP { - return commandLine.IPP(name, "", value, usage) + return CommandLine.IPP(name, "", value, usage) } // Like IP, but accepts a shorthand letter that can be used after a single dash. func IPP(name, shorthand string, value net.IP, usage string) *net.IP { - return commandLine.IPP(name, shorthand, value, usage) + return CommandLine.IPP(name, shorthand, value, usage) } @@ -50,12 +50,12 @@ func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IP // IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. // The argument p points to an net.IPMask variable in which to store the value of the flag. func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) { - commandLine.VarP(newIPMaskValue(value, p), name, "", usage) + CommandLine.VarP(newIPMaskValue(value, p), name, "", usage) } // Like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) { - commandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage) + CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage) } // IPMask defines an net.IPMask flag with specified name, default value, and usage string. @@ -76,10 +76,10 @@ func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string // IPMask defines an net.IPMask flag with specified name, default value, and usage string. // The return value is the address of an net.IPMask variable that stores the value of the flag. func IPMask(name string, value net.IPMask, usage string) *net.IPMask { - return commandLine.IPMaskP(name, "", value, usage) + return CommandLine.IPMaskP(name, "", value, usage) } // Like IP, but accepts a shorthand letter that can be used after a single dash. func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask { - return commandLine.IPMaskP(name, shorthand, value, usage) + return CommandLine.IPMaskP(name, shorthand, value, usage) } @@ -31,12 +31,12 @@ func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, us // StringVar defines a string flag with specified name, default value, and usage string. // The argument p points to a string variable in which to store the value of the flag. func StringVar(p *string, name string, value string, usage string) { - commandLine.VarP(newStringValue(value, p), name, "", usage) + CommandLine.VarP(newStringValue(value, p), name, "", usage) } // Like StringVar, but accepts a shorthand letter that can be used after a single dash. func StringVarP(p *string, name, shorthand string, value string, usage string) { - commandLine.VarP(newStringValue(value, p), name, shorthand, usage) + CommandLine.VarP(newStringValue(value, p), name, shorthand, usage) } // String defines a string flag with specified name, default value, and usage string. @@ -57,10 +57,10 @@ func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *s // String defines a string flag with specified name, default value, and usage string. // The return value is the address of a string variable that stores the value of the flag. func String(name string, value string, usage string) *string { - return commandLine.StringP(name, "", value, usage) + return CommandLine.StringP(name, "", value, usage) } // Like String, but accepts a shorthand letter that can be used after a single dash. func StringP(name, shorthand string, value string, usage string) *string { - return commandLine.StringP(name, shorthand, value, usage) + return CommandLine.StringP(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage st // UintVar defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func UintVar(p *uint, name string, value uint, usage string) { - commandLine.VarP(newUintValue(value, p), name, "", usage) + CommandLine.VarP(newUintValue(value, p), name, "", usage) } // Like UintVar, but accepts a shorthand letter that can be used after a single dash. func UintVarP(p *uint, name, shorthand string, value uint, usage string) { - commandLine.VarP(newUintValue(value, p), name, shorthand, usage) + CommandLine.VarP(newUintValue(value, p), name, shorthand, usage) } // Uint defines a uint flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint // Uint defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func Uint(name string, value uint, usage string) *uint { - return commandLine.UintP(name, "", value, usage) + return CommandLine.UintP(name, "", value, usage) } // Like Uint, but accepts a shorthand letter that can be used after a single dash. func UintP(name, shorthand string, value uint, usage string) *uint { - return commandLine.UintP(name, shorthand, value, usage) + return CommandLine.UintP(name, shorthand, value, usage) } @@ -36,12 +36,12 @@ func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, us // Uint16Var defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func Uint16Var(p *uint16, name string, value uint16, usage string) { - commandLine.VarP(newUint16Value(value, p), name, "", usage) + CommandLine.VarP(newUint16Value(value, p), name, "", usage) } // Like Uint16Var, but accepts a shorthand letter that can be used after a single dash. func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { - commandLine.VarP(newUint16Value(value, p), name, shorthand, usage) + CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage) } // Uint16 defines a uint flag with specified name, default value, and usage string. @@ -62,10 +62,10 @@ func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *u // Uint16 defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func Uint16(name string, value uint16, usage string) *uint16 { - return commandLine.Uint16P(name, "", value, usage) + return CommandLine.Uint16P(name, "", value, usage) } // Like Uint16, but accepts a shorthand letter that can be used after a single dash. func Uint16P(name, shorthand string, value uint16, usage string) *uint16 { - return commandLine.Uint16P(name, shorthand, value, usage) + return CommandLine.Uint16P(name, shorthand, value, usage) } @@ -36,12 +36,12 @@ func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, us // Uint32Var defines a uint32 flag with specified name, default value, and usage string. // The argument p points to a uint32 variable in which to store the value of the flag. func Uint32Var(p *uint32, name string, value uint32, usage string) { - commandLine.VarP(newUint32Value(value, p), name, "", usage) + CommandLine.VarP(newUint32Value(value, p), name, "", usage) } // Like Uint32Var, but accepts a shorthand letter that can be used after a single dash. func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) { - commandLine.VarP(newUint32Value(value, p), name, shorthand, usage) + CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage) } // Uint32 defines a uint32 flag with specified name, default value, and usage string. @@ -62,10 +62,10 @@ func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *u // Uint32 defines a uint32 flag with specified name, default value, and usage string. // The return value is the address of a uint32 variable that stores the value of the flag. func Uint32(name string, value uint32, usage string) *uint32 { - return commandLine.Uint32P(name, "", value, usage) + return CommandLine.Uint32P(name, "", value, usage) } // Like Uint32, but accepts a shorthand letter that can be used after a single dash. func Uint32P(name, shorthand string, value uint32, usage string) *uint32 { - return commandLine.Uint32P(name, shorthand, value, usage) + return CommandLine.Uint32P(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, us // Uint64Var defines a uint64 flag with specified name, default value, and usage string. // The argument p points to a uint64 variable in which to store the value of the flag. func Uint64Var(p *uint64, name string, value uint64, usage string) { - commandLine.VarP(newUint64Value(value, p), name, "", usage) + CommandLine.VarP(newUint64Value(value, p), name, "", usage) } // Like Uint64Var, but accepts a shorthand letter that can be used after a single dash. func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) { - commandLine.VarP(newUint64Value(value, p), name, shorthand, usage) + CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage) } // Uint64 defines a uint64 flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *u // Uint64 defines a uint64 flag with specified name, default value, and usage string. // The return value is the address of a uint64 variable that stores the value of the flag. func Uint64(name string, value uint64, usage string) *uint64 { - return commandLine.Uint64P(name, "", value, usage) + return CommandLine.Uint64P(name, "", value, usage) } // Like Uint64, but accepts a shorthand letter that can be used after a single dash. func Uint64P(name, shorthand string, value uint64, usage string) *uint64 { - return commandLine.Uint64P(name, shorthand, value, usage) + return CommandLine.Uint64P(name, shorthand, value, usage) } @@ -35,12 +35,12 @@ func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage // Uint8Var defines a uint8 flag with specified name, default value, and usage string. // The argument p points to a uint8 variable in which to store the value of the flag. func Uint8Var(p *uint8, name string, value uint8, usage string) { - commandLine.VarP(newUint8Value(value, p), name, "", usage) + CommandLine.VarP(newUint8Value(value, p), name, "", usage) } // Like Uint8Var, but accepts a shorthand letter that can be used after a single dash. func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { - commandLine.VarP(newUint8Value(value, p), name, shorthand, usage) + CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage) } // Uint8 defines a uint8 flag with specified name, default value, and usage string. @@ -61,10 +61,10 @@ func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uin // Uint8 defines a uint8 flag with specified name, default value, and usage string. // The return value is the address of a uint8 variable that stores the value of the flag. func Uint8(name string, value uint8, usage string) *uint8 { - return commandLine.Uint8P(name, "", value, usage) + return CommandLine.Uint8P(name, "", value, usage) } // Like Uint8, but accepts a shorthand letter that can be used after a single dash. func Uint8P(name, shorthand string, value uint8, usage string) *uint8 { - return commandLine.Uint8P(name, shorthand, value, usage) + return CommandLine.Uint8P(name, shorthand, value, usage) } |
