argument

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: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Default  = Optional
	Required = 1
	Optional = 2
	List     = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InputArgument

type InputArgument struct {
	// contains filtered or unexported fields
}

Represents a command line argument.

func New

func New(
	name string,
	mode int,
) *InputArgument

constructor

func (*InputArgument) Default

func (a *InputArgument) Default() string

Returns the default value.

func (*InputArgument) Defaults

func (a *InputArgument) Defaults() []string

Returns the defaults value.

func (*InputArgument) Description

func (a *InputArgument) Description() string

Returns the description text

func (*InputArgument) IsList

func (a *InputArgument) IsList() bool

Returns true if the argument can take multiple values.

func (*InputArgument) IsRequired

func (a *InputArgument) IsRequired() bool

Returns true if the argument is required.

func (*InputArgument) Name

func (a *InputArgument) Name() string

Returns the argument name.

func (*InputArgument) SetDefault

func (a *InputArgument) SetDefault(defaultValue string) *InputArgument

Sets the default value.

func (*InputArgument) SetDefaults

func (a *InputArgument) SetDefaults(values []string) *InputArgument

Sets the default value for array args.

func (*InputArgument) SetDescription

func (a *InputArgument) SetDescription(desc string) *InputArgument

Returns the description text

Jump to

Keyboard shortcuts

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