Documentation
¶
Index ¶
- Variables
- func Confirm(title, description string, defaultValue bool) (bool, error)
- func ConfirmRepos(title string, items []RepoNote) ([]string, error)
- func ConfirmReposWithPreset(title string, items []RepoNote, preset []string) ([]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)
- func SelectReposWithPreset(repos []string, preset []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 ConfirmReposWithPreset ¶ added in v1.3.0
ConfirmReposWithPreset shows the annotated multi-select screen with preset ticked. A review loop passes the previous answer back in so going round again does not undo what the user already unchecked.
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.
func SelectReposWithPreset ¶ added in v1.2.0
SelectReposWithPreset shows the same screen with the given repositories already ticked, so a repeated pass keeps the previous choice. Preset entries that are no longer in the list are ignored.
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.