feat: port apply
command from influxdb
(#160)
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/AlecAivazis/survey/v2/terminal"
|
||||
"github.com/mattn/go-isatty"
|
||||
)
|
||||
|
||||
// terminalStdio interacts with the user via an interactive terminal.
|
||||
@ -55,6 +56,10 @@ func (t *terminalStdio) Error(message string) error {
|
||||
return r.Error(&cfg, errors.New(message))
|
||||
}
|
||||
|
||||
func (t *terminalStdio) InputIsInteractive() bool {
|
||||
return isatty.IsTerminal(t.Stdin.Fd()) || isatty.IsCygwinTerminal(t.Stdin.Fd())
|
||||
}
|
||||
|
||||
// GetStringInput prompts the user for arbitrary input.
|
||||
func (t *terminalStdio) GetStringInput(prompt, defaultValue string) (input string, err error) {
|
||||
question := survey.Input{
|
||||
|
Reference in New Issue
Block a user