[Pgp-tools-commit] r136 - trunk/caff
Peter Palfrader
weasel at costa.debian.org
Tue Jul 19 23:05:34 UTC 2005
Author: weasel
Date: 2005-07-19 23:05:34 +0000 (Tue, 19 Jul 2005)
New Revision: 136
Modified:
trunk/caff/caff
Log:
Still print the question, even if we already know the answer
Modified: trunk/caff/caff
===================================================================
--- trunk/caff/caff 2005-07-19 21:37:08 UTC (rev 135)
+++ trunk/caff/caff 2005-07-19 23:05:34 UTC (rev 136)
@@ -438,12 +438,22 @@
sub ask($$;$$) {
my ($question, $default, $forceyes, $forceno) = @_;
- return $default if $forceyes and $forceno;
- return 1 if $forceyes;
- return 0 if $forceno;
my $answer;
while (1) {
print $question,' ',($default ? '[Y/n]' : '[y/N]'), ' ';
+ if ($forceyes && $forceno) {
+ print "$default (from config/command line)\n";
+ return $default;
+ };
+ if ($forceyes) {
+ print "YES (from config/command line)\n";
+ return 1;
+ };
+ if ($forceno) {
+ print "NO (from config/command line)\n";
+ return 0;
+ };
+
$answer = <STDIN>;
chomp $answer;
last if ((defined $answer) && (length $answer <= 1));
More information about the Pgp-tools-commit
mailing list