cli

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDebugMode

func AddDebugMode(command *cobra.Command, debugRun *bool)

func AddVerboseFlag

func AddVerboseFlag(command *cobra.Command, verbose *bool)

func MarkFlagsRequired

func MarkFlagsRequired(command *cobra.Command, flagNames ...string) error

func NewDebugMenuDriven

func NewDebugMenuDriven() *debugMenuDriven

func NewPtermMenuDriven

func NewPtermMenuDriven() *ptermMenuDriven

func RegisterCommand

func RegisterCommand(parent *cobra.Command, children ...*cobra.Command)

func WithDefaultValue

func WithDefaultValue(defaultValue string) func(*option) error

Types

type MenuDriven interface {
	GetProgressAnimation() ProgressAnimation
	Confirmation(prompt string, opts ...func(*option) error) (proceed bool, err error)
	TextInput(prompt string, opts ...func(*option) error) (string, error)
	TextInputPassword(prompt string) (string, error)
	DropDown(prompt string, options map[string]string, opts ...func(*option) error) (string, error)
	DropDownList(prompt string, options []string, opts ...func(*option) error) (string, error)
}

type ProgressAnimation

type ProgressAnimation interface {
	Start(msg ...any)
	StopWithSuccess(msg ...any)
	StopWithFailure(msg ...any)
	Stop()
}

Jump to

Keyboard shortcuts

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