Documentation ¶
Index ¶
- Constants
- type InputOption
- func (a *InputOption) Default() string
- func (a *InputOption) Defaults() []string
- func (a *InputOption) Description() string
- func (a *InputOption) Equals(b InputOption) bool
- func (a *InputOption) IsAcceptValue() bool
- func (a *InputOption) IsList() bool
- func (a *InputOption) IsValueNone() bool
- func (a *InputOption) IsValueOptional() bool
- func (a *InputOption) IsValueRequired() bool
- func (a *InputOption) Name() string
- func (a *InputOption) SetDefault(defaultValue string) *InputOption
- func (a *InputOption) SetDefaults(values []string) *InputOption
- func (a *InputOption) SetDescription(desc string) *InputOption
- func (a *InputOption) SetShortcut(shortcut string) *InputOption
- func (a *InputOption) Shortcut() string
Constants ¶
View Source
const ( Default = None None = 1 Required = 2 Optional = 4 List = 8 )
View Source
const ( Defined = "true" Undefined = "false" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputOption ¶
type InputOption struct {
// contains filtered or unexported fields
}
Represents a command line option.
func (*InputOption) Defaults ¶
func (a *InputOption) Defaults() []string
Returns the defaults value.
func (*InputOption) Description ¶
func (a *InputOption) Description() string
Returns the description text.
func (*InputOption) Equals ¶
func (a *InputOption) Equals(b InputOption) bool
compare to another option
func (*InputOption) IsAcceptValue ¶
func (a *InputOption) IsAcceptValue() bool
Returns true if the option accepts a value.
func (*InputOption) IsList ¶
func (a *InputOption) IsList() bool
returns true if the option takes an optional value.
func (*InputOption) IsValueNone ¶
func (a *InputOption) IsValueNone() bool
returns true if the option takes an optional value.
func (*InputOption) IsValueOptional ¶
func (a *InputOption) IsValueOptional() bool
returns true if the option takes an optional value.
func (*InputOption) IsValueRequired ¶
func (a *InputOption) IsValueRequired() bool
returns true if the option requires a value.
func (*InputOption) SetDefault ¶
func (a *InputOption) SetDefault(defaultValue string) *InputOption
Sets the default value.
func (*InputOption) SetDefaults ¶
func (a *InputOption) SetDefaults(values []string) *InputOption
Sets the default value for array options
func (*InputOption) SetDescription ¶
func (a *InputOption) SetDescription(desc string) *InputOption
set the option description
func (*InputOption) SetShortcut ¶
func (a *InputOption) SetShortcut(shortcut string) *InputOption
The shortcuts, can be empty, or a string of shortcuts delimited by '|'
Click to show internal directories.
Click to hide internal directories.