diff --git a/flag_generated.go b/flag_generated.go index a3e4d6e..001576c 100644 --- a/flag_generated.go +++ b/flag_generated.go @@ -14,7 +14,6 @@ type BoolFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Destination *bool } @@ -30,11 +29,6 @@ func (f BoolFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f BoolFlag) IsRequired() bool { - return f.Required -} - // Bool looks up the value of a local BoolFlag, returns // false if not found func (c *Context) Bool(name string) bool { @@ -68,7 +62,6 @@ type BoolTFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Destination *bool } @@ -84,11 +77,6 @@ func (f BoolTFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f BoolTFlag) IsRequired() bool { - return f.Required -} - // BoolT looks up the value of a local BoolTFlag, returns // false if not found func (c *Context) BoolT(name string) bool { @@ -122,7 +110,6 @@ type DurationFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value time.Duration Destination *time.Duration @@ -139,11 +126,6 @@ func (f DurationFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f DurationFlag) IsRequired() bool { - return f.Required -} - // Duration looks up the value of a local DurationFlag, returns // 0 if not found func (c *Context) Duration(name string) time.Duration { @@ -177,7 +159,6 @@ type Float64Flag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value float64 Destination *float64 @@ -194,11 +175,6 @@ func (f Float64Flag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f Float64Flag) IsRequired() bool { - return f.Required -} - // Float64 looks up the value of a local Float64Flag, returns // 0 if not found func (c *Context) Float64(name string) float64 { @@ -232,7 +208,6 @@ type GenericFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value Generic } @@ -248,11 +223,6 @@ func (f GenericFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f GenericFlag) IsRequired() bool { - return f.Required -} - // Generic looks up the value of a local GenericFlag, returns // nil if not found func (c *Context) Generic(name string) interface{} { @@ -286,7 +256,6 @@ type Int64Flag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value int64 Destination *int64 @@ -303,11 +272,6 @@ func (f Int64Flag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f Int64Flag) IsRequired() bool { - return f.Required -} - // Int64 looks up the value of a local Int64Flag, returns // 0 if not found func (c *Context) Int64(name string) int64 { @@ -341,7 +305,6 @@ type IntFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value int Destination *int @@ -358,11 +321,6 @@ func (f IntFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f IntFlag) IsRequired() bool { - return f.Required -} - // Int looks up the value of a local IntFlag, returns // 0 if not found func (c *Context) Int(name string) int { @@ -396,7 +354,6 @@ type IntSliceFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value *IntSlice } @@ -412,11 +369,6 @@ func (f IntSliceFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f IntSliceFlag) IsRequired() bool { - return f.Required -} - // IntSlice looks up the value of a local IntSliceFlag, returns // nil if not found func (c *Context) IntSlice(name string) []int { @@ -450,7 +402,6 @@ type Int64SliceFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value *Int64Slice } @@ -466,11 +417,6 @@ func (f Int64SliceFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f Int64SliceFlag) IsRequired() bool { - return f.Required -} - // Int64Slice looks up the value of a local Int64SliceFlag, returns // nil if not found func (c *Context) Int64Slice(name string) []int64 { @@ -504,7 +450,6 @@ type StringFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value string Destination *string @@ -521,11 +466,6 @@ func (f StringFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f StringFlag) IsRequired() bool { - return f.Required -} - // String looks up the value of a local StringFlag, returns // "" if not found func (c *Context) String(name string) string { @@ -559,7 +499,6 @@ type StringSliceFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value *StringSlice } @@ -575,11 +514,6 @@ func (f StringSliceFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f StringSliceFlag) IsRequired() bool { - return f.Required -} - // StringSlice looks up the value of a local StringSliceFlag, returns // nil if not found func (c *Context) StringSlice(name string) []string { @@ -613,7 +547,6 @@ type Uint64Flag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value uint64 Destination *uint64 @@ -630,11 +563,6 @@ func (f Uint64Flag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f Uint64Flag) IsRequired() bool { - return f.Required -} - // Uint64 looks up the value of a local Uint64Flag, returns // 0 if not found func (c *Context) Uint64(name string) uint64 { @@ -668,7 +596,6 @@ type UintFlag struct { Usage string EnvVar string FilePath string - Required bool Hidden bool Value uint Destination *uint @@ -685,11 +612,6 @@ func (f UintFlag) GetName() string { return f.Name } -// IsRequired returns the whether or not the flag is required -func (f UintFlag) IsRequired() bool { - return f.Required -} - // Uint looks up the value of a local UintFlag, returns // 0 if not found func (c *Context) Uint(name string) uint { diff --git a/generate-flag-types b/generate-flag-types index e0b5aa1..1358857 100755 --- a/generate-flag-types +++ b/generate-flag-types @@ -143,7 +143,6 @@ def _write_cli_flag_types(outfile, types): Usage string EnvVar string FilePath string - Required bool Hidden bool """.format(**typedef)) @@ -171,11 +170,6 @@ def _write_cli_flag_types(outfile, types): return f.Name }} - // IsRequired returns the whether or not the flag is required - func (f {name}Flag) IsRequired() bool {{ - return f.Required - }} - // {name} looks up the value of a local {name}Flag, returns // {context_default} if not found func (c *Context) {name}(name string) {context_type} {{