prompt

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CommitTitleMaxLength = 50

Variables

View Source
var ConsoleDevices = []string{
	"/dev/tty",
}
View Source
var ErrCanceled = errors.New("operation canceled")
View Source
var ErrNoStories = errors.New("no stories to choose from")

Functions

func Confirm

func Confirm(question string, defaultChoice bool) (bool, error)

func Dialog added in v0.16.0

func Dialog(value interface{}, questionPrefix string) error

func OpenConsole added in v0.7.0

func OpenConsole(flag int) (io.ReadWriteCloser, error)

func PanicCancel

func PanicCancel()

func Prompt

func Prompt(msg string) (string, error)

Prompt prints the given message and waits for user input. In case the input is empty, ErrCanceled is returned.

func PromptDefault added in v0.16.0

func PromptDefault(msg, defaultValue string) (string, error)

func PromptIndex

func PromptIndex(msg string, min, max int) (int, error)

func RecoverCancel

func RecoverCancel()

func Shorten added in v0.6.0

func Shorten(line string, maxLen int) string

func ShortenCommitTitle added in v0.6.0

func ShortenCommitTitle(title string) string

Types

type InvalidInputError

type InvalidInputError struct {
	Input string
}

func (*InvalidInputError) Error

func (i *InvalidInputError) Error() string

type OutOfBoundsError

type OutOfBoundsError struct {
	Input string
}

func (*OutOfBoundsError) Error

func (i *OutOfBoundsError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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