MCPcopy Index your code
hub / github.com/go-task/task / Text

Method Text

internal/input/input.go:32–51  ·  view source on GitHub ↗

Text prompts the user for a text value

(varName string)

Source from the content-addressed store, hash-verified

30
31// Text prompts the user for a text value
32func (p *Prompter) Text(varName string) (string, error) {
33 m := newTextModel(varName)
34
35 prog := tea.NewProgram(m,
36 tea.WithInput(p.Stdin),
37 tea.WithOutput(p.Stderr),
38 )
39
40 result, err := prog.Run()
41 if err != nil {
42 return "", err
43 }
44
45 model := result.(textModel)
46 if model.cancelled {
47 return "", ErrCancelled
48 }
49
50 return model.value, nil
51}
52
53// Select prompts the user to select from a list of options
54func (p *Prompter) Select(varName string, options []string) (string, error) {

Callers 3

PromptMethod · 0.95
parseGitignoreLinesFunction · 0.80
ReadMethod · 0.80

Calls 2

newTextModelFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected