Documentation
¶
Index ¶
- Variables
- func AskQuestion(question string, defaultAnswer string) string
- func AskSecret(question string) (string, bool)
- func PickSeveral(title string, items []MultiItem, preselected map[int]bool) ([]string, bool)
- func TheEndMessage() tea.Cmd
- type ChoiceModel
- type ErrorMessage
- type InfoMessage
- type InputModel
- type MenuModel
- type MultiItem
- type MultiModel
- type PrintMessage
- type SpinnerModel
- type UpdateMessage
Constants ¶
This section is empty.
Variables ¶
var PathColor = "[light_blue]"
var (
SpinnerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("69"))
)
var TitleColor = "[magenta]"
Functions ¶
func AskQuestion ¶ added in v0.5.6
func AskSecret ¶ added in v0.8.0
AskSecret asks for a value which is not displayed while it is typed. The second result is false when the question was cancelled, which has to be told apart from an empty answer : escaping out of a prompt must never store an empty token.
func PickSeveral ¶ added in v0.8.0
PickSeveral asks for several items of a list to be picked. The second result is false when the list was cancelled.
func TheEndMessage ¶
Types ¶
type ChoiceModel ¶
type ChoiceModel struct {
// contains filtered or unexported fields
}
func InitialChoiceModel ¶
func InitialChoiceModel(title string, choices []string) ChoiceModel
func (ChoiceModel) Init ¶
func (m ChoiceModel) Init() tea.Cmd
func (ChoiceModel) Picked ¶
func (m ChoiceModel) Picked() string
func (ChoiceModel) View ¶
func (m ChoiceModel) View() string
type ErrorMessage ¶
type ErrorMessage struct {
Error string
}
type InfoMessage ¶ added in v0.5.4
type InfoMessage struct {
Message string
}
type InputModel ¶
type InputModel struct {
TextInput textinput.Model
// Cancelled tells that the question was left with escape or ctrl+c instead of being answered.
// Without it an empty answer and a cancel look the same, which must never happen for a secret.
Cancelled bool
// contains filtered or unexported fields
}
func InitialInputModel ¶
func InitialInputModel(q string, ph string) InputModel
func InitialSecretInputModel ¶ added in v0.8.0
func InitialSecretInputModel(q string) InputModel
InitialSecretInputModel asks for a value which must not be displayed while it is typed, such as a token or the passphrase of an ssh key
func (InputModel) Init ¶
func (m InputModel) Init() tea.Cmd
func (InputModel) View ¶
func (m InputModel) View() string
type MenuModel ¶
type MenuModel struct {
Selected map[int]entity.GitFolder // which to-do items are Selected
// contains filtered or unexported fields
}
func InitialMenuModel ¶
type MultiItem ¶ added in v0.8.0
type MultiItem struct {
// Label is what is picked, and what Picked returns
Label string
// Hint is displayed next to the label, dimmed. It must never hold a secret.
Hint string
}
MultiItem is one line of a list several of which can be picked
type MultiModel ¶ added in v0.8.0
type MultiModel struct {
Cancelled bool
// contains filtered or unexported fields
}
MultiModel lets several items of a list be picked. MenuModel does the same for the git folders of the interactive git-info, but it is tied to that type.
func InitialMultiModel ¶ added in v0.8.0
func InitialMultiModel(title string, items []MultiItem, preselected map[int]bool) MultiModel
InitialMultiModel builds the list. The items of preselected start out picked, which is how the platforms needing attention are offered first.
func (MultiModel) Init ¶ added in v0.8.0
func (m MultiModel) Init() tea.Cmd
func (MultiModel) Picked ¶ added in v0.8.0
func (m MultiModel) Picked() []string
Picked returns the labels of the picked items, in the order of the list
func (MultiModel) View ¶ added in v0.8.0
func (m MultiModel) View() string
type PrintMessage ¶
type PrintMessage struct {
Path string
}
type SpinnerModel ¶
type SpinnerModel struct {
Spinner spinner.Model
Text string
Warns []string
// contains filtered or unexported fields
}
func (SpinnerModel) Init ¶
func (m SpinnerModel) Init() tea.Cmd
func (SpinnerModel) View ¶
func (m SpinnerModel) View() string
View renders the spinner and instructions
type UpdateMessage ¶ added in v0.6.0
type UpdateMessage struct {
Message string
}