output

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTerminal

func ClearTerminal()

ClearTerminal tries to clear the screen and scrollback buffer using cross-platform methods.

func Confirm

func Confirm(prompt string) (bool, error)

Confirm prompts the user to confirm an action with a yes/no question.

func ConfirmWithDefault

func ConfirmWithDefault(prompt string, defaultValue bool) (bool, error)

ConfirmWithDefault prompts the user to confirm an action with a yes/no question and a default value.

func DetectPager

func DetectPager() string

DetectPager returns the preferred pager found on PATH.

func GetClearCommand

func GetClearCommand() string

GetClearCommand returns the appropriate clear command for the current platform.

func InputHiddenString

func InputHiddenString(prompt, help string, validator func(string) error) (string, error)

InputHiddenString prompts the user to input a string. The input is hidden from the user. The validator is used to validate the input. The help text is displayed to the user when they ask for help. There is no default value.

func InputString

func InputString(prompt, help, defaultValue string, validator func(string) error) (string, error)

InputString prompts the user to input a string. The input is visible to the user. The validator is used to validate the input. The help text is displayed to the user when they ask for help. If defaultValue is not empty, it will be used as the default value.

func RunPager

func RunPager(pager string, content string) error

RunPager executes the pager and writes content to its stdin.

func SelectString

func SelectString(prompt string, options []string) (string, error)

SelectString prompts the user to select from a list of string options

Types

This section is empty.

Jump to

Keyboard shortcuts

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