kit

package
v0.0.0-...-07a7973 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KitDir         = ".kit"
	ConfigPath     = filepath.Join(KitDir, ConfigFilename)
	ConfigFilename = "config.json"
)

Functions

This section is empty.

Types

type Arg

type Arg interface {
	Type() string
	Usage() string
	Set(v string) error
	Autocomplete(ctx context.Context, input string) []Completion
}

func StringArg

func StringArg(name, usage string, path *string) Arg

type Command

type Command interface {
	Usage() string
	Args() []Arg
	Flags() []Flag
	Run(ctx context.Context) error
}

type Completion

type Completion struct {
	Group    string
	Wordlist []string
}

type Constructor

type Constructor func() (Command, error)

func OpenConstructor

func OpenConstructor(path string) (Constructor, error)

type Flag

type Flag interface {
	Name() string
	Type() string
	Usage() string
	Set(*flag.FlagSet)
	Autocomplete(ctx context.Context, input string) []string
}

func BoolFlag

func BoolFlag(name, usage string, value bool, dst *bool) Flag

func StringFlag

func StringFlag(name, usage, value string, dst *string) Flag

type Stdio

type Stdio struct {
	In  io.Reader
	Out io.Writer
	Err io.Writer
}

Jump to

Keyboard shortcuts

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