Documentation ¶
Index ¶
- func CaptureCommandLineFlags(set *pflag.FlagSet) map[string]interface{}
- type Device
- type Emulator
- type Simulator
- type SnakeCharmer
- func (s *SnakeCharmer) BindAll()
- func (s *SnakeCharmer) Bool(flagName, fieldName string, value bool, usage string)
- func (s *SnakeCharmer) BoolP(flagName, shorthand, fieldName string, value bool, usage string)
- func (s *SnakeCharmer) Float64(flagName, fieldName string, value float64, usage string)
- func (s *SnakeCharmer) Int(flagName, fieldName string, value int, usage string)
- func (s *SnakeCharmer) String(flagName, fieldName, value, usage string)
- func (s *SnakeCharmer) StringP(flagName, shorthand, fieldName, value, usage string)
- func (s *SnakeCharmer) StringSlice(flagName, fieldName string, value []string, usage string)
- func (s *SnakeCharmer) StringToString(flagName, fieldName string, value map[string]string, usage string)
- func (s *SnakeCharmer) StringToStringP(flagName, shorthand, fieldName string, value map[string]string, usage string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureCommandLineFlags ¶ added in v0.57.0
CaptureCommandLineFlags build the map of command line flags of the current execution.
Types ¶
type Device ¶
Device represents the RDC device configuration.
func (*Device) Set ¶
Set sets the device to the values present in s. The input has to be a comma separated string in the format of "key=value,key2=value2". This method is called by cobra when CLI flags are parsed.
type Emulator ¶
Emulator represents the emulator configuration.
func (*Emulator) Set ¶
Set sets the emulator to the values present in s. The input has to be a comma separated string in the format of "key=value,key2=value2". This method is called by cobra when CLI flags are parsed.
type Simulator ¶
Simulator represents the simulator configuration.
func (*Simulator) Set ¶
Set sets the simulator to the values present in s. The input has to be a comma separated string in the format of "key=value,key2=value2". This method is called by cobra when CLI flags are parsed.
type SnakeCharmer ¶ added in v0.52.3
type SnakeCharmer struct { Fset *pflag.FlagSet // Fmap maps field names (key) to flags (value). Fmap map[string]*pflag.Flag }
SnakeCharmer because Cobra and Viper. Get it? It's a convenience wrapper around cobra and viper, allowing the user to declare and bind flags at the same time.
Example:
sc := flags.SnakeCharmer{Fmap: map[string]*pflag.Flag{}} sc.Fset = cmd.Flags() sc.String("name", "suite.name", "", "Set the name of the job as it will appear on Sauce Labs") sc.BindAll()
func (*SnakeCharmer) BindAll ¶ added in v0.53.0
func (s *SnakeCharmer) BindAll()
BindAll binds all previously added flags to their respective fields.
func (*SnakeCharmer) Bool ¶ added in v0.52.3
func (s *SnakeCharmer) Bool(flagName, fieldName string, value bool, usage string)
Bool defines a bool flag with specified flagName, default value, usage string and then binds it to fieldName.
func (*SnakeCharmer) BoolP ¶ added in v0.53.0
func (s *SnakeCharmer) BoolP(flagName, shorthand, fieldName string, value bool, usage string)
BoolP is like Bool(), but accepts a shorthand letter.
func (*SnakeCharmer) Float64 ¶ added in v0.53.0
func (s *SnakeCharmer) Float64(flagName, fieldName string, value float64, usage string)
Float64 defines a float64 flag with specified flagName, default value, usage string and then binds it to fieldName.
func (*SnakeCharmer) Int ¶ added in v0.53.0
func (s *SnakeCharmer) Int(flagName, fieldName string, value int, usage string)
Int defines an int flag with specified flagName, default value, usage string and then binds it to fieldName.
func (*SnakeCharmer) String ¶ added in v0.52.3
func (s *SnakeCharmer) String(flagName, fieldName, value, usage string)
String defines a string flag with specified flagName, default value, usage string and then binds it to fieldName.
func (*SnakeCharmer) StringP ¶ added in v0.53.0
func (s *SnakeCharmer) StringP(flagName, shorthand, fieldName, value, usage string)
StringP is like String(), but accepts a shorthand letter.
func (*SnakeCharmer) StringSlice ¶ added in v0.53.0
func (s *SnakeCharmer) StringSlice(flagName, fieldName string, value []string, usage string)
StringSlice defines a []string flag with specified flagName, default value, usage string and then binds it to fieldName.
func (*SnakeCharmer) StringToString ¶ added in v0.52.3
func (s *SnakeCharmer) StringToString(flagName, fieldName string, value map[string]string, usage string)
StringToString defines a map[string]string flag with specified flagName, default value, usage string and then binds it to fieldName.
func (*SnakeCharmer) StringToStringP ¶ added in v0.53.0
func (s *SnakeCharmer) StringToStringP(flagName, shorthand, fieldName string, value map[string]string, usage string)
StringToStringP is like StringToString(), but accepts a shorthand letter.