{"modulePath":"github.com/aws/amazon-ec2-instance-selector","version":"v1.3.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cli\n\nPackage cli provides functions to build the selector command line interface\n\nPackage cli provides functions to build the selector command line interface\n\n## Types\n\n```go\ntype CommandLineInterface struct {\n\tCommand *cobra.Command\n\tFlags   map[string]interface{}\n\t// contains filtered or unexported fields\n}\n```\nCommandLineInterface is a type to group CLI funcs and state\n\n```go\nfunc New(binaryName string, shortUsage string, longUsage, examples string, run runFunc) CommandLineInterface\n```\nNew creates an instance of CommandLineInterface\n\n```go\nfunc (cl *CommandLineInterface) BoolFlag(name string, shorthand *string, defaultValue *bool, description string)\n```\nBoolFlag creates and registers a flag accepting a boolean\n\n```go\nfunc (cl *CommandLineInterface) BoolFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *bool, description string)\n```\nBoolFlagOnFlagSet creates and registers a flag accepting a boolean for configuration purposes.\n\n```go\nfunc (*CommandLineInterface) BoolMe(i interface{}) *bool\n```\nBoolMe takes an interface and returns a pointer to a bool value If the underlying interface kind is not bool or \\*bool then nil is returned\n\n```go\nfunc (cl *CommandLineInterface) ConfigBoolFlag(name string, shorthand *string, defaultValue *bool, description string)\n```\nConfigBoolFlag creates and registers a flag accepting a boolean for configuration purposes. Config flags will be grouped at the bottom in the output of --help\n\n```go\nfunc (cl *CommandLineInterface) ConfigIntFlag(name string, shorthand *string, defaultValue *int, description string)\n```\nConfigIntFlag creates and registers a flag accepting an Integer for configuration purposes. Config flags will be grouped at the bottom in the output of --help\n\n```go\nfunc (cl *CommandLineInterface) ConfigStringFlag(name string, shorthand *string, defaultValue *string, description string, validationFn validator)\n```\nConfigStringFlag creates and registers a flag accepting a String for configuration purposes. Config flags will be grouped at the bottom in the output of --help\n\n```go\nfunc (cl *CommandLineInterface) ConfigStringOptionsFlag(name string, shorthand *string, defaultValue *string, description string, validOpts []string)\n```\nConfigStringOptionsFlag creates and registers a flag accepting a string and valid options for use in validation. Config flags will be grouped at the bottom in the output of --help\n\n```go\nfunc (cl *CommandLineInterface) ConfigStringSliceFlag(name string, shorthand *string, defaultValue []string, description string)\n```\nConfigStringSliceFlag creates and registers a flag accepting a list of strings. Suite flags will be grouped in the middle of the output --help\n\n```go\nfunc (*CommandLineInterface) Float64Me(i interface{}) *float64\n```\nFloat64Me takes an interface and returns a pointer to a float64 value If the underlying interface kind is not float64 or \\*float64 then nil is returned\n\n```go\nfunc (cl *CommandLineInterface) IntFlag(name string, shorthand *string, defaultValue *int, description string)\n```\nIntFlag creates and registers a flag accepting an Integer\n\n```go\nfunc (cl *CommandLineInterface) IntFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *int, description string)\n```\nIntFlagOnFlagSet creates and registers a flag accepting an Integer\n\n```go\nfunc (*CommandLineInterface) IntMe(i interface{}) *int\n```\nIntMe takes an interface and returns a pointer to an int value If the underlying interface kind is not int or \\*int then nil is returned\n\n```go\nfunc (cl *CommandLineInterface) IntMinMaxRangeFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *int, description string)\n```\nIntMinMaxRangeFlagOnFlagSet creates and registers a min, max, and helper flag each accepting an Integer\n\n```go\nfunc (cl *CommandLineInterface) IntMinMaxRangeFlags(name string, shorthand *string, defaultValue *int, description string)\n```\nIntMinMaxRangeFlags creates and registers a min, max, and helper flag each accepting an Integer\n\n```go\nfunc (*CommandLineInterface) IntRangeMe(i interface{}) *selector.IntRangeFilter\n```\nIntRangeMe takes an interface and returns a pointer to an IntRangeFilter value If the underlying interface kind is not IntRangeFilter or \\*IntRangeFilter then nil is returned\n\n```go\nfunc (cl *CommandLineInterface) ParseAndValidateFlags() (map[string]interface{}, error)\n```\nParseAndValidateFlags will parse flags registered in this instance of CLI from os.Args and then perform validation\n\n```go\nfunc (cl *CommandLineInterface) ParseFlags() (map[string]interface{}, error)\n```\nParseFlags will parse flags registered in this instance of CLI from os.Args\n\n```go\nfunc (cl *CommandLineInterface) ProcessRangeFilterFlags() error\n```\nProcessRangeFilterFlags sets min and max to the appropriate 0 or maxInt bounds based on the 3-tuple that a user specifies for base flag, min, and/or max\n\n```go\nfunc (cl *CommandLineInterface) RatioFlag(name string, shorthand *string, defaultValue *string, description string) error\n```\nRatioFlag creates and registers a flag accepting a Ratio\n\n```go\nfunc (cl *CommandLineInterface) RegexFlag(name string, shorthand *string, defaultValue *string, description string)\n```\nRegexFlag creates and registers a flag accepting a string and validates that it is a valid regex.\n\n```go\nfunc (cl *CommandLineInterface) RegexFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *string, description string)\n```\nRegexFlagOnFlagSet creates and registers a flag accepting a string slice of regular expressions.\n\n```go\nfunc (*CommandLineInterface) RegexMe(i interface{}) *regexp.Regexp\n```\nRegexMe takes an interface and returns a pointer to a regex If the underlying interface kind is not regexp.Regexp or \\*regexp.Regexp then nil is returned\n\n```go\nfunc (cl *CommandLineInterface) SetUntouchedFlagValuesToNil() error\n```\nSetUntouchedFlagValuesToNil iterates through all flags and sets their value to nil if they were not specifically set by the user This allows for a specified value, a negative value (like false or empty string), or an unspecified (nil) entry.\n\n```go\nfunc (cl *CommandLineInterface) StringFlag(name string, shorthand *string, defaultValue *string, description string, validationFn validator)\n```\nStringFlag creates and registers a flag accepting a String and a validator function. The validator function is provided so that more complex flags can be created from a string input.\n\n```go\nfunc (cl *CommandLineInterface) StringFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *string, description string, validationFn validator)\n```\nStringFlagOnFlagSet creates and registers a flag accepting a String and a validator function. The validator function is provided so that more complex flags can be created from a string input.\n\n```go\nfunc (*CommandLineInterface) StringMe(i interface{}) *string\n```\nStringMe takes an interface and returns a pointer to a string value If the underlying interface kind is not string or \\*string then nil is returned\n\n```go\nfunc (cl *CommandLineInterface) StringOptionsFlag(name string, shorthand *string, defaultValue *string, description string, validOpts []string)\n```\nStringOptionsFlag creates and registers a flag accepting a string and valid options for use in validation.\n\n```go\nfunc (cl *CommandLineInterface) StringOptionsFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *string, description string, validOpts []string)\n```\nStringOptionsFlagOnFlagSet creates and registers a flag accepting a String with valid options. The validOpts slice of strings will be used to perform validation\n\n```go\nfunc (cl *CommandLineInterface) StringSliceFlag(name string, shorthand *string, defaultValue []string, description string)\n```\nStringSliceFlag creates and registers a flag accepting a list of strings.\n\n```go\nfunc (cl *CommandLineInterface) StringSliceFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue []string, description string)\n```\nStringSliceFlagOnFlagSet creates and registers a flag accepting a String Slice.\n\n```go\nfunc (*CommandLineInterface) StringSliceMe(i interface{}) *[]string\n```\nStringSliceMe takes an interface and returns a pointer to a string slice If the underlying interface kind is not \\[]string or \\*\\[]string then nil is returned\n\n```go\nfunc (cl *CommandLineInterface) SuiteBoolFlag(name string, shorthand *string, defaultValue *bool, description string)\n```\nSuiteBoolFlag creates and registers a flag accepting a boolean for aggregate filters. Suite flags will be grouped in the middle of the output --help\n\n```go\nfunc (cl *CommandLineInterface) SuiteStringFlag(name string, shorthand *string, defaultValue *string, description string, validationFn validator)\n```\nSuiteStringFlag creates and registers a flag accepting a string for aggreagate filters. Suite flags will be grouped in the middle of the output --help\n\n```go\nfunc (cl *CommandLineInterface) SuiteStringOptionsFlag(name string, shorthand *string, defaultValue *string, description string, validOpts []string)\n```\nSuiteStringOptionsFlag creates and registers a flag accepting a string and valid options for use in validation. Suite flags will be grouped in the middle of the output --help\n\n```go\nfunc (cl *CommandLineInterface) SuiteStringSliceFlag(name string, shorthand *string, defaultValue []string, description string)\n```\nSuiteStringSliceFlag creates and registers a flag accepting a list of strings. Suite flags will be grouped in the middle of the output --help\n\n```go\nfunc (cl *CommandLineInterface) ValidateFlags() error\n```\nValidateFlags iterates through any registered validators and executes them\n\n","path":"github.com/aws/amazon-ec2-instance-selector/pkg/cli","name":"cli","synopsis":"Package cli provides functions to build the selector command line interface Package cli provides functions to build the selector command line interface","isRedistributable":true}
