Documentation
¶
Index ¶
- Variables
- func Confirm(title, description string, defaultValue bool) (bool, error)
- func ConfirmRepos(title string, items []RepoNote) ([]string, error)
- func InputPrefilled(title, description, initial string) (string, error)
- func InputText(title, description, defaultValue string) (string, error)
- func InputVersion(repo string, defaultVersion string) (string, error)
- func SelectRepos(repos []string) ([]string, error)
- type PickerAction
- type PickerItem
- type PickerResult
- type RepoNote
Constants ¶
This section is empty.
Variables ¶
var ErrAborted = errors.New("aborted by user")
ErrAborted is returned when the user quits a TUI screen without confirming.
Functions ¶
func ConfirmRepos ¶ added in v1.1.0
ConfirmRepos shows the same multi-select screen with every entry already checked, so the user only has to uncheck what they want to leave out.
func InputPrefilled ¶
InputPrefilled asks for optional text with the current value already typed in so it can be edited or deleted. Unlike InputText an empty answer stays empty.
func InputText ¶
InputText asks for a single line of text. An empty answer falls back to defaultValue, which is also shown as the placeholder.
func InputVersion ¶
InputVersion shows a text input to edit/confirm the next version of a repo.
func SelectRepos ¶
SelectRepos shows a multi-select screen to choose repositories.
Types ¶
type PickerAction ¶
type PickerAction int
PickerAction is what the user asked for on the picker screen.
const ( PickSelected PickerAction = iota PickNew PickDelete PickEdit )
type PickerItem ¶
PickerItem is one selectable row with an optional second line.
type PickerResult ¶
type PickerResult struct {
Action PickerAction
Index int
Label string
}
PickerResult reports the chosen action and item.
func Pick ¶
func Pick(title, hint string, items []PickerItem, allowManage bool) (PickerResult, error)
Pick shows a single-select screen. When allowManage is true the new/edit/ delete shortcuts are offered as well.