Documentation ¶
Index ¶
- type InputDefinition
- func (i *InputDefinition) AddArgument(arg argument.InputArgument) *InputDefinition
- func (i *InputDefinition) AddArguments(arguments []argument.InputArgument) *InputDefinition
- func (i *InputDefinition) AddOption(opt option.InputOption) *InputDefinition
- func (i *InputDefinition) AddOptions(options []option.InputOption) *InputDefinition
- func (i *InputDefinition) Argument(name string) *argument.InputArgument
- func (i *InputDefinition) ArgumentCount() int
- func (i *InputDefinition) ArgumentDefaults() map[string][]string
- func (i *InputDefinition) ArgumentRequiredCount() int
- func (i *InputDefinition) Arguments() map[string]argument.InputArgument
- func (i *InputDefinition) ArgumentsOrder() []string
- func (i *InputDefinition) FindOptionForShortcut(s string) *option.InputOption
- func (i *InputDefinition) HasArgument(name string) bool
- func (i *InputDefinition) HasOption(name string) bool
- func (i *InputDefinition) HasShortcut(s string) bool
- func (i *InputDefinition) Option(name string) *option.InputOption
- func (i *InputDefinition) OptionDefaults() map[string][]string
- func (i *InputDefinition) Options() map[string]option.InputOption
- func (i *InputDefinition) OptionsOrder() []string
- func (i *InputDefinition) SetArguments(arguments []argument.InputArgument) *InputDefinition
- func (i *InputDefinition) SetOptions(options []option.InputOption) *InputDefinition
- func (i *InputDefinition) ShortcutToName(s string) string
- func (i *InputDefinition) Synopsis(short bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputDefinition ¶
type InputDefinition struct {
// contains filtered or unexported fields
}
A InputDefinition represents a set of valid command line arguments and options.
func (*InputDefinition) AddArgument ¶
func (i *InputDefinition) AddArgument(arg argument.InputArgument) *InputDefinition
panic when incorrect argument is given
func (*InputDefinition) AddArguments ¶
func (i *InputDefinition) AddArguments(arguments []argument.InputArgument) *InputDefinition
Adds an array of InputArgument objects.
func (*InputDefinition) AddOption ¶
func (i *InputDefinition) AddOption(opt option.InputOption) *InputDefinition
panic when option given already exist
func (*InputDefinition) AddOptions ¶
func (i *InputDefinition) AddOptions(options []option.InputOption) *InputDefinition
Adds an array of InputOption objects.
func (*InputDefinition) Argument ¶
func (i *InputDefinition) Argument(name string) *argument.InputArgument
Returns an InputArgument by name or by position
func (*InputDefinition) ArgumentCount ¶
func (i *InputDefinition) ArgumentCount() int
Returns the number of InputArguments.
func (*InputDefinition) ArgumentDefaults ¶
func (i *InputDefinition) ArgumentDefaults() map[string][]string
Gets the default values.
func (*InputDefinition) ArgumentRequiredCount ¶
func (i *InputDefinition) ArgumentRequiredCount() int
Returns the number of required InputArguments.
func (*InputDefinition) Arguments ¶
func (i *InputDefinition) Arguments() map[string]argument.InputArgument
Gets the array of InputArgument objects
func (*InputDefinition) ArgumentsOrder ¶
func (i *InputDefinition) ArgumentsOrder() []string
Gets the array of InputArgument keys ordered
func (*InputDefinition) FindOptionForShortcut ¶
func (i *InputDefinition) FindOptionForShortcut(s string) *option.InputOption
Gets an InputOption by shortcut.
func (*InputDefinition) HasArgument ¶
func (i *InputDefinition) HasArgument(name string) bool
Returns true if an InputArgument object exists by name or position.
func (*InputDefinition) HasOption ¶
func (i *InputDefinition) HasOption(name string) bool
Returns true if an InputArgument object exists by name or position.
func (*InputDefinition) HasShortcut ¶
func (i *InputDefinition) HasShortcut(s string) bool
returns true if an InputOption object exists by shortcut.
func (*InputDefinition) Option ¶
func (i *InputDefinition) Option(name string) *option.InputOption
Returns an InputOption by name
func (*InputDefinition) OptionDefaults ¶
func (i *InputDefinition) OptionDefaults() map[string][]string
Gets the default values.
func (*InputDefinition) Options ¶
func (i *InputDefinition) Options() map[string]option.InputOption
Gets the array of InputOption objects
func (*InputDefinition) OptionsOrder ¶
func (i *InputDefinition) OptionsOrder() []string
Gets the array of InputOption keys ordered
func (*InputDefinition) SetArguments ¶
func (i *InputDefinition) SetArguments(arguments []argument.InputArgument) *InputDefinition
Sets the InputArgument objects.
func (*InputDefinition) SetOptions ¶
func (i *InputDefinition) SetOptions(options []option.InputOption) *InputDefinition
sets the InputOption objects.
func (*InputDefinition) ShortcutToName ¶
func (i *InputDefinition) ShortcutToName(s string) string
Returns the InputOption name given a shortcut.
func (*InputDefinition) Synopsis ¶
func (i *InputDefinition) Synopsis(short bool) string
Returns the InputOption name given a shortcut.