Documentation
¶
Index ¶
- Variables
- type Prompt
- func (p *Prompt) Ask(message string) *Prompt
- func (p Prompt) Choose(choices []string, opts ...choose.Option) (string, error)
- func (p Prompt) Init() tea.Cmd
- func (p Prompt) Input(defaultValue string, opts ...input.Option) (string, error)
- func (p Prompt) MultiChoose(choices []string, opts ...multichoose.Option) ([]string, error)
- func (p *Prompt) Run(pm PromptModel) (PromptModel, error)
- func (p *Prompt) SetModel(pm PromptModel) *Prompt
- func (p Prompt) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (p Prompt) View() string
- func (p *Prompt) WithHelp(enable bool) *Prompt
- func (p *Prompt) WithProgramOptions(opts ...tea.ProgramOption) *Prompt
- func (p *Prompt) WithTestView(initView *string, finalView *string) *Prompt
- func (p Prompt) Write(defaultValue string) (string, error)
- type PromptModel
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrModelConversion = errors.New("model conversion failed") ErrUserQuit = errors.New("user quit prompt") )
Functions ¶
This section is empty.
Types ¶
type Prompt ¶
type Prompt struct {
// Style
Message string
NormalPrefix string
FinishPrefix string
NormalSuffix string
FinishSuffix string
PrefixStyle lipgloss.Style
FinishPrefixStyle lipgloss.Style
SuffixStyle lipgloss.Style
FinishSuffixStyle lipgloss.Style
// contains filtered or unexported fields
}
func (Prompt) MultiChoose ¶
MultiChoose lets the user choose multiples from the given choices.
func (*Prompt) Run ¶
func (p *Prompt) Run(pm PromptModel) (PromptModel, error)
Run runs the program using the given model, blocking until the user chooses or exits.
func (*Prompt) SetModel ¶
func (p *Prompt) SetModel(pm PromptModel) *Prompt
SetModel sets the model used by the prompt. In most cases you won't need to use this.
func (*Prompt) WithProgramOptions ¶ added in v0.4.0
func (p *Prompt) WithProgramOptions(opts ...tea.ProgramOption) *Prompt
WithProgramOptions sets the `tea.ProgramOption` passed when calling `tea.NewProgram`. This function is mainly used for testing, usually you don't need to use this function.
func (*Prompt) WithTestView ¶ added in v0.5.1
Directories
¶
| Path | Synopsis |
|---|---|
|
choose
command
|
|
|
choose-theme-arrow
command
|
|
|
choose-theme-line
command
|
|
|
choose-with-help
command
|
|
|
input
command
|
|
|
input-echo-none
command
|
|
|
input-echo-password
command
|
|
|
input-integer-only
command
|
|
|
input-number-only
command
|
|
|
input-with-help
command
|
|
|
input-with-validation
command
|
|
|
multichoose
command
|
|
|
multichoose-theme-dot
command
|
|
|
multichoose-with-help
command
|
|
|
write
command
|
|
|
write-with-help
command
|
|
Click to show internal directories.
Click to hide internal directories.











