Merge pull request #6332 from thaJeztah/28.x_deprecate_prompt_utils
[28.x] cli/command: deprecate prompt utilities that were for internal use
This commit is contained in:
@ -17,12 +17,17 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// ErrPromptTerminated is returned if the user terminated the prompt.
|
||||
//
|
||||
// Deprecated: this error is for internal use and will be removed in the next release.
|
||||
const ErrPromptTerminated = prompt.ErrTerminated
|
||||
|
||||
// DisableInputEcho disables input echo on the provided streams.In.
|
||||
// This is useful when the user provides sensitive information like passwords.
|
||||
// The function returns a restore function that should be called to restore the
|
||||
// terminal state.
|
||||
//
|
||||
// Deprecated: this function is for internal use and will be removed in the next release.
|
||||
func DisableInputEcho(ins *streams.In) (restore func() error, err error) {
|
||||
return prompt.DisableInputEcho(ins)
|
||||
}
|
||||
@ -34,6 +39,8 @@ func DisableInputEcho(ins *streams.In) (restore func() error, err error) {
|
||||
// When the prompt returns an error, the caller should propagate the error up
|
||||
// the stack and close the io.Reader used for the prompt which will prevent the
|
||||
// background goroutine from blocking indefinitely.
|
||||
//
|
||||
// Deprecated: this function is for internal use and will be removed in the next release.
|
||||
func PromptForInput(ctx context.Context, in io.Reader, out io.Writer, message string) (string, error) {
|
||||
return prompt.ReadInput(ctx, in, out, message)
|
||||
}
|
||||
@ -48,6 +55,8 @@ func PromptForInput(ctx context.Context, in io.Reader, out io.Writer, message st
|
||||
// When the prompt returns an error, the caller should propagate the error up
|
||||
// the stack and close the io.Reader used for the prompt which will prevent the
|
||||
// background goroutine from blocking indefinitely.
|
||||
//
|
||||
// Deprecated: this function is for internal use and will be removed in the next release.
|
||||
func PromptForConfirmation(ctx context.Context, ins io.Reader, outs io.Writer, message string) (bool, error) {
|
||||
return prompt.Confirm(ctx, ins, outs, message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user