Documentation ¶
Index ¶
- Constants
- Variables
- func Confirm(question string, defaultChoice bool) (bool, error)
- func Dialog(value interface{}, questionPrefix string) error
- func OpenConsole(flag int) (io.ReadWriteCloser, error)
- func PanicCancel()
- func Prompt(msg string) (string, error)
- func PromptDefault(msg, defaultValue string) (string, error)
- func PromptIndex(msg string, min, max int) (int, error)
- func RecoverCancel()
- func Shorten(line string, maxLen int) string
- func ShortenCommitTitle(title string) string
- type InvalidInputError
- type OutOfBoundsError
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 OpenConsole ¶ added in v0.7.0
func OpenConsole(flag int) (io.ReadWriteCloser, error)
func PanicCancel ¶
func PanicCancel()
func Prompt ¶
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 RecoverCancel ¶
func RecoverCancel()
func ShortenCommitTitle ¶ added in v0.6.0
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
Click to show internal directories.
Click to hide internal directories.