Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prompt ¶
type Prompt struct {
Command string // Where does it call when complete?
Rest string // What is the 'rest' of the command
Questions []*Question // All questions so far
State map[string]any // Optional place to store state
}
func (*Prompt) GetNextQuestion ¶
Returns the next pending question.
type Question ¶
type Question struct {
Question string // What's the prompt?
Options []string // What options (if any) are available? None = freeform
DefaultResponse string // What is the default response?
Response string // What was the response last submitted
Done bool // Was it seen and responded to?
Flags int // Mask reply etc
}
func (*Question) Answer ¶
If fewer than 2 choices provided, answer is what they enter. If they provide an empty string, and a default respnose is provided, answer is default.
func (*Question) RejectResponse ¶
func (q *Question) RejectResponse()
Click to show internal directories.
Click to hide internal directories.