mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-16 16:23:30 +00:00
OptionParser nnow prints password prompt to STDERR - issue 1290911
This commit is contained in:
@@ -2117,6 +2117,32 @@ is(
|
||||
"--optimize got its value (bug 1199589)"
|
||||
);
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# Issue 1290911 : prompt_noecho should send prompt to STDERR so user can
|
||||
# direct STDOUT to a file and still see the prompt
|
||||
# #############################################################################
|
||||
|
||||
$o = new OptionParser();
|
||||
|
||||
$output = output(
|
||||
sub {
|
||||
my $input = "thepassword";
|
||||
local *STDIN;
|
||||
open STDIN, '<', \$input;
|
||||
$o->prompt_noecho('Test Prompt:'); },
|
||||
|
||||
stderr=>1,
|
||||
);
|
||||
|
||||
is (
|
||||
$output,
|
||||
"Test Prompt:\n",
|
||||
'prompt_no_echo outputs prompt to STDERR'
|
||||
);
|
||||
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
@@ -2133,3 +2159,6 @@ like(
|
||||
|
||||
done_testing;
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user