Documentation ¶
Overview ¶
Package cliquiz is a tool to collect answers from the users on cli.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValuesFromFlagsOrAsk ¶
func ValuesFromFlagsOrAsk(fset *pflag.FlagSet, title string, flags ...Flag) (values map[string]string, err error)
ValuesFromFlagsOrAsk returns values of flags within map[string]string where map's key is the name of the flag and value is flag's value. when provided, values are collected through command otherwise they're asked to user by prompting. title used as a message while prompting.
Types ¶
type Option ¶
type Option func(*Question)
Option configures Question.
func DefaultAnswer ¶
func DefaultAnswer(answer interface{}) Option
DefaultAnswer sets a default answer to Question.
func HideAnswer ¶
func HideAnswer() Option
HideAnswer hides the answer to prevent secret information being leaked.
type Question ¶
type Question struct {
// contains filtered or unexported fields
}
Question holds information on what to ask to user and where the answer stored at.
func NewQuestion ¶
NewQuestion creates a new question.
Click to show internal directories.
Click to hide internal directories.