output

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(prompt string) bool

Confirm is a wrapper function for Confirmer that uses os.Stdin for input, os.Stdout for output and a no operation Confirmer.Renderer.

Types

type Confirmer

type Confirmer struct {
	MaxRetries int
	Renderer   style.RenderFunc
}

func (Confirmer) Confirm

func (c Confirmer) Confirm(prompt string, in io.Reader, out io.Writer) bool

Confirm shows the user via out parameter a prompt in order to confirm the action. The input is read via the in parameter and keeps retrying until "yes/no" or "y/n" is found.

Blocks until correct input is given or the number of retries exceeded MaxRetries.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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