Skip to content

Commit 5184f2e

Browse files
Merge pull request #6332 from thaJeztah/28.x_deprecate_prompt_utils
[28.x] cli/command: deprecate prompt utilities that were for internal use
2 parents 5ef48d6 + cb42a72 commit 5184f2e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cli/command/utils.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ import (
1717
"github.com/pkg/errors"
1818
)
1919

20+
// ErrPromptTerminated is returned if the user terminated the prompt.
21+
//
22+
// Deprecated: this error is for internal use and will be removed in the next release.
2023
const ErrPromptTerminated = prompt.ErrTerminated
2124

2225
// DisableInputEcho disables input echo on the provided streams.In.
2326
// This is useful when the user provides sensitive information like passwords.
2427
// The function returns a restore function that should be called to restore the
2528
// terminal state.
29+
//
30+
// Deprecated: this function is for internal use and will be removed in the next release.
2631
func DisableInputEcho(ins *streams.In) (restore func() error, err error) {
2732
return prompt.DisableInputEcho(ins)
2833
}
@@ -34,6 +39,8 @@ func DisableInputEcho(ins *streams.In) (restore func() error, err error) {
3439
// When the prompt returns an error, the caller should propagate the error up
3540
// the stack and close the io.Reader used for the prompt which will prevent the
3641
// background goroutine from blocking indefinitely.
42+
//
43+
// Deprecated: this function is for internal use and will be removed in the next release.
3744
func PromptForInput(ctx context.Context, in io.Reader, out io.Writer, message string) (string, error) {
3845
return prompt.ReadInput(ctx, in, out, message)
3946
}
@@ -48,6 +55,8 @@ func PromptForInput(ctx context.Context, in io.Reader, out io.Writer, message st
4855
// When the prompt returns an error, the caller should propagate the error up
4956
// the stack and close the io.Reader used for the prompt which will prevent the
5057
// background goroutine from blocking indefinitely.
58+
//
59+
// Deprecated: this function is for internal use and will be removed in the next release.
5160
func PromptForConfirmation(ctx context.Context, ins io.Reader, outs io.Writer, message string) (bool, error) {
5261
return prompt.Confirm(ctx, ins, outs, message)
5362
}

0 commit comments

Comments
 (0)