cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 5 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
	Required    bool
	Description string
}

type Args

type Args struct {
	Args            []Arg
	AllowAdditional bool
}

type Command

type Command struct {
	Short                  string
	Args                   Args
	Flags                  Flags
	MutuallyExclusiveFlags [][]string
	RequiredFlagSet        [][]string
	PreRun                 func()
	Run                    func(args []string, flags Flags) error
	Subcommands            map[string]*Command
	// contains filtered or unexported fields
}

func (*Command) Help

func (c *Command) Help()

type Flag

type Flag interface {
	IsRequired() bool
	GetShort() string
	GetUsage() string
	Parse() func() error
	Set() bool
	AddToFlagSet(name string, fs *pflag.FlagSet)
}

type Flags

type Flags map[string]Flag

type RootCommand

type RootCommand struct {
	Name string
	*Command
}

func (*RootCommand) Execute

func (c *RootCommand) Execute()

func (*RootCommand) ExecuteColon

func (c *RootCommand) ExecuteColon()

func (*RootCommand) Init

func (c *RootCommand) Init() error

func (*RootCommand) InitColon

func (c *RootCommand) InitColon() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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