import "github.com/ubclaunchpad/inertia/cmd/core/utils/input"
Package input provides input parsing utilities for the Inertia CLI
var ( // ErrEmptyInput is returned on empty imputs - toggle with AllowEmpty ErrEmptyInput = errors.New("empty input") // ErrInvalidInput is returned on disallowed inputs - toggle with AllowInvalid ErrInvalidInput = errors.New("invalid input") )
func CatchSigterm(cancelFunc func())
CatchSigterm listens in the background for some kind of interrupt and calls the given cancelFunc as necessary
PromptConfig offers prompt configuration
type PromptInteraction struct {
// contains filtered or unexported fields
}
PromptInteraction is a builder for interactions - use .PromptX followed by .GetX
func NewPrompt(conf *PromptConfig) *PromptInteraction
NewPrompt instantiates a new prompt interaction on standard in
func NewPromptOnInput(in io.Reader, conf *PromptConfig) *PromptInteraction
NewPromptOnInput instantiates a new prompt on specified input
func (p *PromptInteraction) GetBool() (bool, error)
GetBool retrieves a boolean response based on "y" or "yes"
func (p *PromptInteraction) GetString() (string, error)
GetString retreives the raw string response from the prompt
func (p *PromptInteraction) Prompt(query ...interface{}) *PromptInteraction
Prompt prints the given query and reads the response
func (p *PromptInteraction) PromptFromList(optionName string, options []string) *PromptInteraction
PromptFromList creates a choose-one-from-x prompt
func (p *PromptInteraction) Promptf(query string, args ...interface{}) *PromptInteraction
Promptf prints the given query and reads the response
Package input imports 8 packages (graph) and is imported by 10 packages. Updated 2020-04-02. Refresh now. Tools for package owners.