package prompt
import "src.elv.sh/pkg/cli/prompt"
Package prompt provides an implementation of the cli.Prompt interface.
Index ¶
Package Files ¶
type Config ¶
❖
type Config struct { // The function that computes the prompt. Compute func() ui.Text // Function to transform stale prompts. StaleTransform func(ui.Text) ui.Text // Threshold for a prompt to be considered as stale. StaleThreshold func() time.Duration // How eager the prompt should be updated. When >= 5, updated when directory // is changed. When >= 10, always update. Default is 5. Eagerness func() int }
Config keeps configurations for the prompt.
type Prompt ¶
❖
type Prompt struct {
// contains filtered or unexported fields
}
Prompt implements a prompt that is executed asynchronously.
func New ¶
New makes a new prompt.
func (*Prompt) Get ¶
Get returns the current content of the prompt.
func (*Prompt) LateUpdates ¶
LateUpdates returns a channel on which late updates are made available.
func (*Prompt) Trigger ¶
Trigger triggers an update to the prompt.
Package prompt imports 4 packages (graph) and is imported by 1 packages. Updated 2 weeks ago.
Tools for package owners.