ui

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindPrompt

func BindPrompt(p *Prompt, shell *readline.Shell)

BindPrompt reassigns the prompt printing functions to the shell helpers.

Types

type Prompt

type Prompt struct {
	Primary   func() string            // Primary is the main prompt.
	Secondary func() string            // Secondary is the prompt used when the user is typing a multi-line command.
	Transient func() string            // Transient is used if the console shell is configured to be transient.
	Right     func() string            // Right is the prompt printed on the right side of the screen.
	Tooltip   func(word string) string // Tooltip is used to hint on the root command, replacing right prompts if not empty.
}

Prompt - A prompt is a set of functions that return the strings to print for each prompt type. The console will call these functions to retrieve the prompt strings to print. Each menu has its own prompt.

func NewPrompt

func NewPrompt(appName, menuName string, stdout *bytes.Buffer) *Prompt

NewPrompt requires the name of the application and the current menu, as well as the current menu output buffer to produce a new, default prompt.

Jump to

Keyboard shortcuts

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