prompt

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	// Long version of the expected user input
	Long string
	// Short version of the expected user input
	Short string
	// Runs when user input matches
	Callback func()
	// Runs after Callback and after logging resumes
	EndCallback func()

	AskAgain bool
}

Answer is a user input of a prompt question.

type Prompt

type Prompt struct {
	// contains filtered or unexported fields
}

Prompt used for interactive user input.

func New

func New(question string) *Prompt

New returns a new prompt.

func (*Prompt) Add

func (p *Prompt) Add(answer Answer)

Add an answer.

func (*Prompt) Ask

func (p *Prompt) Ask()

Ask a question.

Jump to

Keyboard shortcuts

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