cli

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

命令行补全 版本查看

命令行提示

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompletionCmd

func CompletionCmd(appName string) *cobra.Command

func VersionCmd

func VersionCmd(appName, version, buildTime, gitCommit string) *cobra.Command

Types

type Action

type Action struct {
	Suggest   prompt.Suggest
	Executor  ExecutorHandler
	Completer CompleterHandler
	// contains filtered or unexported fields
}

func (*Action) AddSubAction

func (a *Action) AddSubAction(actions ...*Action)

type CompleterHandler

type CompleterHandler func() ([]prompt.Suggest, bool)

type ExecutorHandler

type ExecutorHandler func([]string)

type Prompt

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

func NewPrompt

func NewPrompt() *Prompt

func (*Prompt) Complete

func (p *Prompt) Complete(d prompt.Document) []prompt.Suggest

func (*Prompt) Execute

func (p *Prompt) Execute(in string)

func (*Prompt) RegisterAction

func (p *Prompt) RegisterAction(actions ...*Action)

Jump to

Keyboard shortcuts

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