Documentation ¶
Index ¶
- Constants
- type Definitions
- type Description
- type GetOptError
- type Option
- func (option Option) DescriptionText() (description string)
- func (option Option) EnvVar() (envVar string)
- func (option Option) HasEnvVar() (result bool)
- func (option Option) HasLongOpt() (result bool)
- func (option Option) HasShortOpt() (result bool)
- func (option Option) HelpText(longOptLength int) (output string)
- func (option Option) Key() (key string)
- func (option Option) LongOpt() (longOpt string)
- func (option Option) LongOptString() (longOptString string)
- func (option Option) ShortOpt() (shortOpt string)
- func (option Option) ShortOptString() (shortOptString string)
- func (option Option) Usage() (usageString string)
- type OptionValue
- type Options
- func (options Options) ConfigOptionKey() (key string)
- func (options Options) FindOption(optionString string) (option Option, found bool)
- func (options Options) Help() (output string)
- func (options Options) HelpCustomArg0(arg0 string) (output string)
- func (options Options) IsFlag(optionName string) (isFlag bool)
- func (options Options) IsOptional(optionName string) (isRequired bool)
- func (options Options) IsRequired(optionName string) (isRequired bool)
- func (optionsDefinition Options) ParseCommandLine() (options map[string]OptionValue, arguments []string, passThrough []string, ...)
- func (options Options) RequiredArguments() (requiredOptions Options)
- func (options Options) RequiredOptions() (requiredOptions []string)
- func (options Options) Usage() (output string)
- func (options Options) UsageCustomArg0(arg0 string) (output string)
- type Scopes
- type SubCommandOptions
- func (sco SubCommandOptions) Help() (output string)
- func (sco SubCommandOptions) HelpCustomArg0(arg0 string) (output string)
- func (sco SubCommandOptions) ParseCommandLine() (subCommand string, options map[string]OptionValue, arguments []string, ...)
- func (sco SubCommandOptions) Usage() (output string)
- func (sco SubCommandOptions) UsageCustomArg0(arg0 string) (output string)
- type SubCommands
- type SubSubCommandOptions
- func (ssco SubSubCommandOptions) Help() (output string)
- func (ssco SubSubCommandOptions) HelpCustomArg0(arg0 string) (output string)
- func (ssco SubSubCommandOptions) ParseCommandLine() (scope string, subCommand string, options map[string]OptionValue, ...)
- func (ssco SubSubCommandOptions) Usage() (output string)
- func (ssco SubSubCommandOptions) UsageCustomArg0(arg0 string) (output string)
Constants ¶
View Source
const ( InvalidOption = iota MissingValue InvalidValue MissingOption OptionValueError ConsistencyError ConfigFileNotFound ConfigParsed MissingArgument NoSubCommand NoScope UnknownSubCommand UnknownScope )
View Source
const ( Required = 1 << iota Optional Flag NoLongOpt ExampleIsDefault IsArg Argument Usage Help IsPassThrough IsConfigFile NoEnvHelp IsSubCommand )
View Source
const OPTIONS_SEPARATOR = "--"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definitions ¶
type Definitions []Option
type Description ¶
type Description string
type GetOptError ¶
type GetOptError struct { ErrorCode int // contains filtered or unexported fields }
func (*GetOptError) Error ¶
func (err *GetOptError) Error() (message string)
type Option ¶
type Option struct { OptionDefinition string Description string Flags int DefaultValue interface{} }
func (Option) DescriptionText ¶
func (Option) HasLongOpt ¶
func (Option) HasShortOpt ¶
func (Option) LongOptString ¶
func (Option) ShortOptString ¶
type OptionValue ¶
type Options ¶
type Options struct { Description Description Definitions Definitions }
func (Options) ConfigOptionKey ¶
func (Options) FindOption ¶
func (Options) HelpCustomArg0 ¶
func (Options) IsOptional ¶
func (Options) IsRequired ¶
func (Options) ParseCommandLine ¶
func (optionsDefinition Options) ParseCommandLine() (options map[string]OptionValue, arguments []string, passThrough []string, err *GetOptError)
func (Options) RequiredArguments ¶
func (Options) RequiredOptions ¶
func (Options) UsageCustomArg0 ¶
type Scopes ¶
type Scopes map[string]SubCommandOptions
type SubCommandOptions ¶
type SubCommandOptions struct { Global Options SubCommands SubCommands }
func (SubCommandOptions) Help ¶
func (sco SubCommandOptions) Help() (output string)
func (SubCommandOptions) HelpCustomArg0 ¶
func (sco SubCommandOptions) HelpCustomArg0(arg0 string) (output string)
func (SubCommandOptions) ParseCommandLine ¶
func (sco SubCommandOptions) ParseCommandLine() (subCommand string, options map[string]OptionValue, arguments []string, passThrough []string, err *GetOptError)
func (SubCommandOptions) Usage ¶
func (sco SubCommandOptions) Usage() (output string)
func (SubCommandOptions) UsageCustomArg0 ¶
func (sco SubCommandOptions) UsageCustomArg0(arg0 string) (output string)
type SubCommands ¶
type SubSubCommandOptions ¶
func (SubSubCommandOptions) Help ¶
func (ssco SubSubCommandOptions) Help() (output string)
func (SubSubCommandOptions) HelpCustomArg0 ¶
func (ssco SubSubCommandOptions) HelpCustomArg0(arg0 string) (output string)
func (SubSubCommandOptions) ParseCommandLine ¶
func (ssco SubSubCommandOptions) ParseCommandLine() (scope string, subCommand string, options map[string]OptionValue, arguments []string, passThrough []string, err *GetOptError)
func (SubSubCommandOptions) Usage ¶
func (ssco SubSubCommandOptions) Usage() (output string)
func (SubSubCommandOptions) UsageCustomArg0 ¶
func (ssco SubSubCommandOptions) UsageCustomArg0(arg0 string) (output string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.