ui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UpCommand = &MenuCompleter{Suggestion: &prompt.Suggest{Text: "..",
		Description: "move to the parent menu",
	}}
	HelpCommand = &MenuCompleter{Suggestion: &prompt.Suggest{
		Text:        "help",
		Description: "show the help for the current menu",
	}}
	ExitCommand = &MenuCompleter{Suggestion: &prompt.Suggest{
		Text:        "exit",
		Description: "exit the interactive console",
	}}
	TailCommands = []*MenuCompleter{UpCommand, HelpCommand, ExitCommand}
)

Functions

func InputBigInt

func InputBigInt(pr string) *big.Int

func InputBigIntWithDefault

func InputBigIntWithDefault(pr string, d *big.Int) *big.Int

func InputFilename

func InputFilename(pr string, rootPath string, mustExit bool) (string, error)

func InputIntWithDefault

func InputIntWithDefault(pr string, def int) (int, bool)

func InputMultiChoice

func InputMultiChoice(pr string, def string, choices []prompt.Suggest, helpFunc func(c []prompt.Suggest)) (string, bool)

func InputMultiChoiceString

func InputMultiChoiceString(pr string, def string, choices []string, helpFunc func(c []prompt.Suggest)) (string, bool)

func InputPassword

func InputPassword() (string, error)

func InputPath

func InputPath(pr string, rootPath string, mustExist bool, pathToSuggestionFn func(path string, text string) (prompt.Suggest, bool)) (string, error)

func InputText

func InputText(pr string) string

func InputYesNo

func InputYesNo(pr string, def bool) (bool, bool)

func NewAbsolutePathFilter

func NewAbsolutePathFilter(rootPath string) func(string, string) (prompt.Suggest, bool)

func ShowHelp

func ShowHelp(node *MenuCompleter)

Types

type MenuCompleter struct {
	Suggestion *prompt.Suggest
	Sub        []*MenuCompleter
	Parent     *MenuCompleter
}

func NewMenuCompleter

func NewMenuCompleter(cmd *cobra.Command, parent *MenuCompleter) *MenuCompleter

func NewRootNode

func NewRootNode(entries []*MenuCompleter) *MenuCompleter
func (cc *MenuCompleter) Completer(doc prompt.Document) []prompt.Suggest
func (cc *MenuCompleter) Name() string
func (cc *MenuCompleter) Prompt(p string) string

Jump to

Keyboard shortcuts

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