prompt

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2015 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 ListStories

func ListStories(stories []common.Story, w io.Writer) (err 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 PromptIndex

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

func PromptStory

func PromptStory(msg string, stories []common.Story) (common.Story, error)

func PromptStoryAllowNone added in v0.7.0

func PromptStoryAllowNone(msg string, stories []common.Story) (common.Story, 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

Jump to

Keyboard shortcuts

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