Documentation
¶
Index ¶
- Variables
- func ThemeDefault(msg string, state State, model string) string
- func ThemeDefaultClear(msg string, state State, model string) string
- type Option
- type Prompt
- func (p Prompt) AdvancedChoose(choices []choose.Choice, opts ...choose.Option) (string, error)
- 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, opts ...tea.ProgramOption) (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) Write(defaultValue string, opts ...write.Option) (string, error)
- type PromptModel
- type State
- type Theme
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrModelConversion = errors.New("model conversion failed") ErrUserQuit = constants.ErrUserQuit )
Functions ¶
Types ¶
type Option ¶ added in v0.8.0
type Option func(*Prompt)
func WithTeaProgramOpts ¶ added in v0.9.0
func WithTeaProgramOpts(opts ...tea.ProgramOption) Option
type Prompt ¶
type Prompt struct {
Message string
// contains filtered or unexported fields
}
func (Prompt) AdvancedChoose ¶ added in v0.9.0
Choose lets the user choose one of the given choices.
func (Prompt) MultiChoose ¶
MultiChoose lets the user choose multiples from the given choices.
func (*Prompt) Run ¶
func (p *Prompt) Run(pm PromptModel, opts ...tea.ProgramOption) (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.
type PromptModel ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
_examples
|
|
|
advancedchoose
command
|
|
|
choose
command
|
|
|
choose-themes
command
|
|
|
input
command
|
|
|
input-echo-none
command
|
|
|
input-echo-password
command
|
|
|
input-integer-only
command
|
|
|
input-number-only
command
|
|
|
input-options
command
|
|
|
input-with-validation
command
|
|
|
multichoose
command
|
|
|
multichoose-options
command
|
|
|
multichoose-themes
command
|
|
|
prompt-clear-screen
command
|
|
|
prompt-themes
command
|
|
|
tea-program-options
command
|
|
|
write
command
|
|
|
write-options
command
|
|
|
write-with-validation
command
|
|
Click to show internal directories.
Click to hide internal directories.










