option

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: 1

Documentation

Index

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 New

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

constructor

func (*InputOption) Default

func (a *InputOption) Default() string

Returns the default value.

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) Name

func (a *InputOption) Name() string

Returns the option name.

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 '|'

func (*InputOption) Shortcut

func (a *InputOption) Shortcut() string

Returns the option shortcut.

Jump to

Keyboard shortcuts

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