flags

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFlagsNotSetError

func NewFlagsNotSetError(flags []string) error

Types

type Bool

type Bool struct {
	Required bool
	Default  bool
	Short    string
	Usage    string
	Target   *bool
	// contains filtered or unexported fields
}

func (*Bool) AddToFlagSet

func (f *Bool) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*Bool) GetShort

func (f *Bool) GetShort() string

func (*Bool) GetUsage

func (f *Bool) GetUsage() string

func (*Bool) IsRequired

func (f *Bool) IsRequired() bool

func (*Bool) Parse

func (f *Bool) Parse() func() error

func (*Bool) Set

func (f *Bool) Set() bool

func (*Bool) Value

func (f *Bool) Value() interface{}

type DelayedEmbedded

type DelayedEmbedded struct {
	Required    bool
	Short       string
	Usage       string
	Flags       map[string]cli.Flags
	Delimiter   string
	FlagChooser func() (*string, error)
	// contains filtered or unexported fields
}

func (*DelayedEmbedded) AddToFlagSet

func (f *DelayedEmbedded) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*DelayedEmbedded) GetShort

func (f *DelayedEmbedded) GetShort() string

func (*DelayedEmbedded) GetUsage

func (f *DelayedEmbedded) GetUsage() string

func (*DelayedEmbedded) IsRequired

func (f *DelayedEmbedded) IsRequired() bool

func (*DelayedEmbedded) Parse

func (f *DelayedEmbedded) Parse() func() error

func (*DelayedEmbedded) Set

func (f *DelayedEmbedded) Set() bool

type Embedded

type Embedded struct {
	Required bool
	Short    string
	Usage    string
	Flags    cli.Flags
	// contains filtered or unexported fields
}

Embedded is a Flag that allows you to parse multiple values from the same flag. For example, if c is an embedded flag with two string flags, bar and buzz, you could say --c "bar=hello,buzz=world".

func (*Embedded) AddToFlagSet

func (f *Embedded) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*Embedded) GetShort

func (f *Embedded) GetShort() string

func (*Embedded) GetUsage

func (f *Embedded) GetUsage() string

func (*Embedded) IsRequired

func (f *Embedded) IsRequired() bool

func (*Embedded) Parse

func (f *Embedded) Parse() func() error

func (*Embedded) Set

func (f *Embedded) Set() bool

type IPNet

type IPNet struct {
	Name     string
	Required bool
	Default  net.IPNet
	Short    string
	Usage    string
	Target   *net.IPNet
	// contains filtered or unexported fields
}

func (*IPNet) AddToFlagSet

func (f *IPNet) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*IPNet) GetShort

func (f *IPNet) GetShort() string

func (*IPNet) GetUsage

func (f *IPNet) GetUsage() string

func (*IPNet) IsRequired

func (f *IPNet) IsRequired() bool

func (*IPNet) Parse

func (f *IPNet) Parse() func() error

func (*IPNet) Set

func (f *IPNet) Set() bool

type Int

type Int struct {
	Required bool
	Default  int
	Short    string
	Usage    string
	Target   *int
	// contains filtered or unexported fields
}

func (*Int) AddToFlagSet

func (f *Int) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*Int) GetShort

func (f *Int) GetShort() string

func (*Int) GetUsage

func (f *Int) GetUsage() string

func (*Int) IsRequired

func (f *Int) IsRequired() bool

func (*Int) Parse

func (f *Int) Parse() func() error

func (*Int) Set

func (f *Int) Set() bool

type Int32

type Int32 struct {
	Required bool
	Default  int32
	Short    string
	Usage    string
	Target   *int32
	// contains filtered or unexported fields
}

func (*Int32) AddToFlagSet

func (f *Int32) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*Int32) GetShort

func (f *Int32) GetShort() string

func (*Int32) GetUsage

func (f *Int32) GetUsage() string

func (*Int32) IsRequired

func (f *Int32) IsRequired() bool

func (*Int32) Parse

func (f *Int32) Parse() func() error

func (*Int32) Set

func (f *Int32) Set() bool

type Path

type Path struct {
	Required bool
	Default  tree.Path
	Short    string
	Usage    string
	Target   *tree.Path
	// contains filtered or unexported fields
}

func (*Path) AddToFlagSet

func (f *Path) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*Path) GetShort

func (f *Path) GetShort() string

func (*Path) GetUsage

func (f *Path) GetUsage() string

func (*Path) IsRequired

func (f *Path) IsRequired() bool

func (*Path) Parse

func (f *Path) Parse() func() error

func (*Path) Set

func (f *Path) Set() bool

type PathSubcomponent

type PathSubcomponent struct {
	Required bool
	Default  tree.PathSubcomponent
	Short    string
	Usage    string
	Target   *tree.PathSubcomponent
	// contains filtered or unexported fields
}

func (*PathSubcomponent) AddToFlagSet

func (f *PathSubcomponent) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*PathSubcomponent) GetShort

func (f *PathSubcomponent) GetShort() string

func (*PathSubcomponent) GetUsage

func (f *PathSubcomponent) GetUsage() string

func (*PathSubcomponent) IsRequired

func (f *PathSubcomponent) IsRequired() bool

func (*PathSubcomponent) Parse

func (f *PathSubcomponent) Parse() func() error

func (*PathSubcomponent) Set

func (f *PathSubcomponent) Set() bool

type String

type String struct {
	Required bool
	Default  string
	Short    string
	Usage    string
	Target   *string
	// contains filtered or unexported fields
}

func (*String) AddToFlagSet

func (f *String) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*String) GetShort

func (f *String) GetShort() string

func (*String) GetUsage

func (f *String) GetUsage() string

func (*String) IsRequired

func (f *String) IsRequired() bool

func (*String) Parse

func (f *String) Parse() func() error

func (*String) Set

func (f *String) Set() bool

type StringArray

type StringArray struct {
	Required bool
	Default  string
	Short    string
	Usage    string
	Target   *[]string
	// contains filtered or unexported fields
}

func (*StringArray) AddToFlagSet

func (f *StringArray) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*StringArray) GetShort

func (f *StringArray) GetShort() string

func (*StringArray) GetUsage

func (f *StringArray) GetUsage() string

func (*StringArray) IsRequired

func (f *StringArray) IsRequired() bool

func (*StringArray) Parse

func (f *StringArray) Parse() func() error

func (*StringArray) Set

func (f *StringArray) Set() bool

type StringSlice

type StringSlice struct {
	Required bool
	Default  []string
	Short    string
	Usage    string
	Target   *[]string
	// contains filtered or unexported fields
}

func (*StringSlice) AddToFlagSet

func (f *StringSlice) AddToFlagSet(name string, flags *pflag.FlagSet)

func (*StringSlice) GetShort

func (f *StringSlice) GetShort() string

func (*StringSlice) GetUsage

func (f *StringSlice) GetUsage() string

func (*StringSlice) IsRequired

func (f *StringSlice) IsRequired() bool

func (*StringSlice) Parse

func (f *StringSlice) Parse() func() error

func (*StringSlice) Set

func (f *StringSlice) Set() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL