prompt

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfirmOptions added in v1.0.44

type ConfirmOptions struct {
	DefaultYes bool `default:"true"`
	StyleOptions
}

type PrintOptions added in v1.0.44

type PrintOptions struct {
	LeftIndent int
	StyleOptions
}

type Prompt

type Prompt interface {
	// Confirm prompts a user for confirmation, returning true if they answer "y" or "yes"
	// and false otherwise.
	//
	// The default answer (controlled by the DefaultYes option) will be returned if
	// they hit enter without answering yes or no.
	//
	// Loops until a valid value is supplied.
	Confirm(message string, options ...func(*ConfirmOptions)) (bool, error)
	// Print is for printing a large block of text to the terminal
	Print(text string, options ...func(*PrintOptions)) error
	// Newline prints newlines to the console. If count not specified, one newline is printed
	Newline(count ...int) error
}

func New

func New() Prompt

New return a new Prompt instance.

type StyleOptions added in v1.0.44

type StyleOptions struct {
	Bold bool `default:"false"`
	Wrap bool `default:"true"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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