Subject: | Patch to disable input history |
Motivated by this stackoverflow question
(http://stackoverflow.com/questions/14341038/ioprompter-is-it-possible-
to-disable-history), here's a patch that uses 'NONE' as the name of a
special history set that does not record the input into the history.
Subject: | no-history.patch |
--- IO-Prompter-0.004002/lib/IO/Prompter.pm 2012-09-24 04:39:24.000000000 -0500
+++ change/lib/IO/Prompter.pm 2013-01-15 13:03:03.160164225 -0600
@@ -239,7 +239,7 @@
}
# "Those who remember history are enabled to repeat it"...
- if (defined $input) {
+ if (defined $input and $opt_ref->{-history} ne "NONE") {
my $history_set = $history_cache{ $opt_ref->{-history} } //= [] ;
@{ $history_set } = ($input, grep { $_ ne $input } @{ $history_set });
}
@@ -2342,7 +2342,7 @@
The C<prompt()> subroutine also tracks previous input and allows you to
complete with that instead. No special option is required, as the
-feature is always enabled.
+feature is enabled by default.
At the start of a prompted input, the user can cycle backwards through
previous inputs by pressing C<< <CTRL-R> >> (this can be changed
@@ -2428,6 +2428,8 @@
$address .= prompt "Address (line $n):", -hADDR;
}
+If you specify C<'NONE'> as the history set then the input is not
+recorded in the history. This is useful when inputting passwords.
=head4 Configuring the autocompletion interaction