prompt

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var New = newPrompt

New instantiates a prompt which satisfied Prompt with c-bata/go-prompt. New will be replace by a mock when e2e testing.

Prompt will panic when called Run if executor is nil.

TODO: Don't declare New as a variable.

Functions

This section is empty.

Types

type Prompt

type Prompt interface {
	// Run executes Input continually.
	// It is called from REPL input prompter.
	// Run will be finished when a user enters CTRL+d.
	Run()

	// Input receives user entered input.
	// Input will be abort when a user enters CTRL+d.
	Input() (string, error)

	// Select displays a selection has options, opts.
	Select(msg string, opts []string) (string, error)

	// SetPrefix changes the current prompt prefix by passed one.
	SetPrefix(prefix string)

	// SetPrefixColor changes the current prompt color by passed one.
	SetPrefixColor(color color.Color) error

	// History returns Input() history as a string slice.
	// A older command is a newer executed command.
	History() []string
}

Prompt provides interactive interfaces to receive user input.

Jump to

Keyboard shortcuts

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