definition

package
v1.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2024 License: Unlicense Imports: 5 Imported by: 2

Documentation

Index

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 New

func New() *InputDefinition

constructor

func (*InputDefinition) AddArgument

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL