Documentation
¶
Overview ¶
Package ask helps with writing simple yes/no cli-based questions. There are several methods, following these rules
Methods starting with "Must" do not return an error. Instead they panic if an error occurs (pty not available? closed stdin/stdout?).
Methods containing "Default" have an extra argument (placed first), which is returned when the user simply hits [enter].
When user replies with "y", "Y" or "yes", true is returned When user replies with "n", "N" or "no", false is returned
Methods with a trailing "f" wrap fmt.Sprintf
Index ¶
- func Ask(question string) (bool, error)
- func Askf(questionFormat string, a ...interface{}) (bool, error)
- func DefaultAsk(def bool, question string) (bool, error)
- func DefaultAskf(def bool, questionFormat string, a ...interface{}) (bool, error)
- func MustAsk(question string) bool
- func MustAskf(questionFormat string, a ...interface{}) bool
- func MustDefaultAsk(def bool, question string) bool
- func MustDefaultAskf(def bool, questionFormat string, a ...interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAskf ¶
func MustDefaultAsk ¶
func MustDefaultAskf ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.