Documentation ¶
Overview ¶
Package dialog allows the user to enter configuration data via CLI dialogs and prompts.
Index ¶
- Constants
- func AskHowToHandleUnfinishedRunState(command, endBranch string, endTime time.Time, canSkip bool) (string, error)
- func Initialize()
- func ModalSelect(entries ModalEntries, initialValue string) (*string, error)
- func MultiSelect(args MultiSelectArgs) ([]string, error)
- func Select(opts SelectArgs) (string, error)
- func SelectAuthor(branch string, authors []string) (string, error)
- func SelectSquashCommitAuthor(branch string, authors []string) (string, error)
- type ModalEntries
- type ModalEntry
- type MultiSelectArgs
- type SelectArgs
Constants ¶
const ( // ResponseTypeAbort stands for the user choosing to abort the unfinished run state. ResponseTypeAbort = "abort" // ResponseTypeContinue stands for the user choosing to continue the unfinished run state. ResponseTypeContinue = "continue" // ResponseTypeDiscard stands for the user choosing to discard the unfinished run state. ResponseTypeDiscard = "discard" // ResponseTypeQuit stands for the user choosing to quit the program. ResponseTypeQuit = "quit" // ResponseTypeSkip stands for the user choosing to continue the unfinished run state by skipping the current branch. ResponseTypeSkip = "skip" )
Variables ¶
This section is empty.
Functions ¶
func AskHowToHandleUnfinishedRunState ¶
func AskHowToHandleUnfinishedRunState(command, endBranch string, endTime time.Time, canSkip bool) (string, error)
AskHowToHandleUnfinishedRunState prompts the user for how to handle the unfinished run state.
func ModalSelect ¶
func ModalSelect(entries ModalEntries, initialValue string) (*string, error)
ModalSelect allows the user to select a value from the given entries. Entries can be arbitrarily formatted. The given initial value is preselected.
func MultiSelect ¶
func MultiSelect(args MultiSelectArgs) ([]string, error)
MultiSelect displays a visual dialog that allows the user to select multiple entries amongst the given options.
func Select ¶
func Select(opts SelectArgs) (string, error)
Select displays a visual dialog that allows the user to select one of the given options.
func SelectAuthor ¶
SelectAuthor allows the user to select an author amongst a given list of authors.
Types ¶
type ModalEntries ¶
type ModalEntries []ModalEntry
ModalEntries is a collection of ModalEntry.
func (ModalEntries) IndexOfValue ¶
func (mes ModalEntries) IndexOfValue(value string) *int
IndexOfValue provides the index of the entry with the given value, or nil if the given value is not in the list.
type ModalEntry ¶
ModalEntry contains one of the many entries that the user can choose from.