mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-16 21:58:38 +00:00
Vincent Batts
45591ed121
It seems this may be the last update to urfave/cli for go1.17, as their v2.25 uses generics of go1.18 and didn't partition it with build tags 😵😵😵 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
48 lines
711 B
Go
48 lines
711 B
Go
package cli
|
|
|
|
import "flag"
|
|
|
|
type extFlag struct {
|
|
f *flag.Flag
|
|
}
|
|
|
|
func (e *extFlag) Apply(fs *flag.FlagSet) error {
|
|
fs.Var(e.f.Value, e.f.Name, e.f.Usage)
|
|
return nil
|
|
}
|
|
|
|
func (e *extFlag) Names() []string {
|
|
return []string{e.f.Name}
|
|
}
|
|
|
|
func (e *extFlag) IsSet() bool {
|
|
return false
|
|
}
|
|
|
|
func (e *extFlag) String() string {
|
|
return FlagStringer(e)
|
|
}
|
|
|
|
func (e *extFlag) IsVisible() bool {
|
|
return true
|
|
}
|
|
|
|
func (e *extFlag) TakesValue() bool {
|
|
return false
|
|
}
|
|
|
|
func (e *extFlag) GetUsage() string {
|
|
return e.f.Usage
|
|
}
|
|
|
|
func (e *extFlag) GetValue() string {
|
|
return e.f.Value.String()
|
|
}
|
|
|
|
func (e *extFlag) GetDefaultText() string {
|
|
return e.f.DefValue
|
|
}
|
|
|
|
func (e *extFlag) GetEnvVars() []string {
|
|
return nil
|
|
}
|