cli

package
v0.0.0-...-8fa78e2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ETX = 0x3 // control-C
)

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(parents []*cobra.Command, command *cobra.Command) *cobra.Command

add cobra command to given parent(s) and returns given command

func FilterCompletions

func FilterCompletions(list []string, toComplete string, directive *cobra.ShellCompDirective, help string) []string

filter all strings starting with string to complete

func WaitForCtrlC

func WaitForCtrlC(input io.Reader)

wait for CTRL-C

Types

type ValidateFn

type ValidateFn = func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func AppendHelp

func AppendHelp(helpTxt string) ValidateFn

add active help text for argument, and show if argument is empty

func AppendLastHelp

func AppendLastHelp(total int, helpTxt string) ValidateFn

add active help text shown when last valid argument is already entered

func ValidateArguments

func ValidateArguments(fns ...ValidateFn) ValidateFn

execute completion commands per argument

Jump to

Keyboard shortcuts

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