cli

package
v0.0.0-...-51a9299 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Name string // name as it appears on command line
	// contains filtered or unexported fields
}

type ArgSet

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

func (*ArgSet) Get

func (set *ArgSet) Get(name string) string

func (*ArgSet) Length

func (set *ArgSet) Length() int

func (*ArgSet) Set

func (set *ArgSet) Set(name string)

type Command

type Command struct {
	Name             string
	ShortDescription string
	LongDescription  string
	Example          string
	Run              func(cmd *Command, args []string) ([]interface{}, error)
	HelpType         Help
	// contains filtered or unexported fields
}

func (*Command) AddCommand

func (parentCmd *Command) AddCommand(cmds ...*Command)

func (*Command) Args

func (cmd *Command) Args() *ArgSet

func (*Command) Execute

func (cmd *Command) Execute(options ...Options) ([]interface{}, error)

func (*Command) Flags

func (cmd *Command) Flags() *FlagSet

type FlagSet

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

A wrapper to extend functionality.

func (*FlagSet) Bool

func (flagSet *FlagSet) Bool(name string, defaultValue bool, usage string) *bool

func (*FlagSet) GetBool

func (flagSet *FlagSet) GetBool(name string) (bool, error)

func (*FlagSet) GetInt

func (flagSet *FlagSet) GetInt(name string) (int, error)

func (*FlagSet) GetString

func (flagSet *FlagSet) GetString(name string) string

func (*FlagSet) Int

func (flagSet *FlagSet) Int(name string, defaultValue int, usage string) *int

func (*FlagSet) String

func (flagSet *FlagSet) String(name string, defaultValue string, usage string) *string

func (*FlagSet) Value

func (flagSet *FlagSet) Value(name string) string

type Help

type Help int
const (
	Default Help = iota
	Custom
	None
)

type Options

type Options struct {
	Args []string
}

Jump to

Keyboard shortcuts

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