Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions libs/cmdio/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,35 +203,6 @@ func RunSelect(ctx context.Context, prompt *promptui.Select) (int, string, error
return prompt.Run()
}

func (c *cmdIO) simplePrompt(label string) *promptui.Prompt {
return &promptui.Prompt{
Label: label,
Stdin: io.NopCloser(c.in),
Stdout: nopWriteCloser{c.out},
}
}

func (c *cmdIO) SimplePrompt(label string) (value string, err error) {
return c.simplePrompt(label).Run()
}

func SimplePrompt(ctx context.Context, label string) (value string, err error) {
c := fromContext(ctx)
return c.SimplePrompt(label)
}

func (c *cmdIO) DefaultPrompt(label, defaultValue string) (value string, err error) {
prompt := c.simplePrompt(label)
prompt.Default = defaultValue
prompt.AllowEdit = true
return prompt.Run()
}

func DefaultPrompt(ctx context.Context, label, defaultValue string) (value string, err error) {
c := fromContext(ctx)
return c.DefaultPrompt(label, defaultValue)
}

func (c *cmdIO) Spinner(ctx context.Context) chan string {
var sp *spinner.Spinner
if c.interactive {
Expand Down
Loading