cli

package
v0.0.0-...-aa11db5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Name              string
	Help              string
	Required          bool
	Remaining         bool
	CompletionHandler ArgumentCompletionFunc
	// contains filtered or unexported fields
}

func (*Argument) GetValue

func (a *Argument) GetValue() string

func (*Argument) GetValues

func (a *Argument) GetValues() []string

func (*Argument) IsSet

func (a *Argument) IsSet() bool

type ArgumentCompletionFunc

type ArgumentCompletionFunc func(prev string, cur string) []string

type BoolOption

type BoolOption struct {
	Name    byte
	Default bool
	Help    string
	// contains filtered or unexported fields
}

func (*BoolOption) GetCompletionHandler

func (o *BoolOption) GetCompletionHandler() OptionCompletionFunc

func (*BoolOption) GetHelp

func (o *BoolOption) GetHelp() string

func (*BoolOption) GetMetavar

func (o *BoolOption) GetMetavar() string

func (*BoolOption) GetName

func (o *BoolOption) GetName() byte

func (*BoolOption) GetValue

func (o *BoolOption) GetValue() bool

func (*BoolOption) IsFlag

func (o *BoolOption) IsFlag() bool

func (*BoolOption) IsSet

func (o *BoolOption) IsSet() bool

func (*BoolOption) SetDefault

func (o *BoolOption) SetDefault()

func (*BoolOption) SetValue

func (o *BoolOption) SetValue(v string) error

type Cli

type Cli struct {
	Help      string
	Version   string
	Options   []Option
	Arguments []*Argument
	// contains filtered or unexported fields
}

func (*Cli) Parse

func (c *Cli) Parse()

func (*Cli) Usage

func (c *Cli) Usage(full bool)

type Option

type Option interface {
	GetName() byte
	GetHelp() string
	GetMetavar() string
	SetValue(v string) error
	SetDefault()
	IsFlag() bool
	IsSet() bool
	GetCompletionHandler() OptionCompletionFunc
}

type OptionCompletionFunc

type OptionCompletionFunc func(cur string) []string

type StringOption

type StringOption struct {
	Name              byte
	Default           string
	Help              string
	Metavar           string
	CompletionHandler OptionCompletionFunc
	// contains filtered or unexported fields
}

func (*StringOption) GetCompletionHandler

func (o *StringOption) GetCompletionHandler() OptionCompletionFunc

func (*StringOption) GetHelp

func (o *StringOption) GetHelp() string

func (*StringOption) GetMetavar

func (o *StringOption) GetMetavar() string

func (*StringOption) GetName

func (o *StringOption) GetName() byte

func (*StringOption) GetValue

func (o *StringOption) GetValue() string

func (*StringOption) IsFlag

func (o *StringOption) IsFlag() bool

func (*StringOption) IsSet

func (o *StringOption) IsSet() bool

func (*StringOption) SetDefault

func (o *StringOption) SetDefault()

func (*StringOption) SetValue

func (o *StringOption) SetValue(v string) error

Jump to

Keyboard shortcuts

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