cli

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HelpTemplate = `` /* 702-byte string literal not displayed */

Functions

This section is empty.

Types

type AutocompleteFunc

type AutocompleteFunc func(ctx context.Context, input string) []kit.Completion

func AutocompleteCommand

func AutocompleteCommand(kitCmd kit.Command, args []string, depth int) AutocompleteFunc

func AutocompleteNamespace

func AutocompleteNamespace(cliCmd *Command, args []string, depth int) AutocompleteFunc

type Cli

type Cli struct {
	NamespacePath  []string
	NamespaceUsage string
	Commands       []*Command
	UsageError     error
	// contains filtered or unexported fields
}

func NewCli

func NewCli(loader *Loader) *Cli

func (*Cli) Args

func (c *Cli) Args() []string

func (*Cli) DecorateArg

func (c *Cli) DecorateArg(arg string) string

func (*Cli) DecorateArgs

func (c *Cli) DecorateArgs(inputs []config.Arg) []string

func (*Cli) DecorateCommand

func (c *Cli) DecorateCommand(command string) string

func (*Cli) DecorateCommandPath

func (c *Cli) DecorateCommandPath(commandPath []string) []string

func (*Cli) DecorateFlag

func (c *Cli) DecorateFlag(flag config.Flag) string

func (*Cli) DecorateFlags

func (c *Cli) DecorateFlags(inputs []config.Flag) []string

func (*Cli) DecorateGlobalFlag

func (c *Cli) DecorateGlobalFlag(flag string) string

func (*Cli) DecorateHeader

func (c *Cli) DecorateHeader(header string) string

func (*Cli) DecorateUsageError

func (c *Cli) DecorateUsageError(header string) string

func (*Cli) Flags

func (c *Cli) Flags() []kit.Flag

func (*Cli) GetCommand

func (c *Cli) GetCommand(ctx context.Context, plugin config.Plugin, args []string) (*Command, error)

func (*Cli) GetManifest

func (c *Cli) GetManifest(ctx context.Context, plugin config.Plugin) (config.Manifest, error)

func (*Cli) Options

func (c *Cli) Options() introspect.Options

func (*Cli) Parse

func (c *Cli) Parse(args []string) error

func (*Cli) PrintHelp

func (c *Cli) PrintHelp(commands []*Command) error

func (*Cli) SetNamespaceUsage

func (c *Cli) SetNamespaceUsage(commandPath []string, usage string)

func (*Cli) Theme

func (c *Cli) Theme() introspect.Theme

type Command

type Command struct {
	CommandPath  []string
	Usage        string
	Args         []config.Arg
	Flags        []config.Flag
	Verify       VerifyFunc
	Autocomplete AutocompleteFunc
	Action       func(ctx context.Context) error
	Commands     []*Command
}

type Kit

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

func NewKit

func NewKit() *Kit

func (*Kit) Run

func (k *Kit) Run(ctx context.Context, args []string) error

type Loader

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

func NewLoader

func NewLoader(store content.Store) *Loader

func (*Loader) FindPlugin

func (l *Loader) FindPlugin(ctx context.Context, plugin config.Plugin, args []string) (config.Plugin, int, error)

func (*Loader) GetCommand

func (l *Loader) GetCommand(ctx context.Context, plugin config.Plugin, args []string) (*Command, error)

func (*Loader) GetManifest

func (l *Loader) GetManifest(ctx context.Context, plugin config.Plugin) (config.Manifest, error)

type VerifyFunc

type VerifyFunc func(c *Cli) error

func VerifyCommand

func VerifyCommand(cliCmd *Command, kitCmd kit.Command, args []string) VerifyFunc

func VerifyNamespace

func VerifyNamespace(cliCmd *Command, args []string, depth int) VerifyFunc

Jump to

Keyboard shortcuts

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