X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=caff%2Fcaff;h=dd74de713e7d963d779e02de22bdaf3ea679bef3;hb=69675ad2603874fef5a6f7df3fd31bbb04ed01b5;hp=e4f69a9155c29506c5e95ab39bfdb4c5b478cfd7;hpb=03fe24eba2e5a9d1d829305aada0489cdf88f842;p=pgp-tools.git diff --git a/caff/caff b/caff/caff index e4f69a9..dd74de7 100755 --- a/caff/caff +++ b/caff/caff @@ -438,12 +438,22 @@ sub readwrite_gpg($$$$$%) { 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 = ; chomp $answer; last if ((defined $answer) && (length $answer <= 1)); @@ -1083,7 +1093,7 @@ for my $keyid (@keyids_ok) { if (!$uid->{'is_uat'} && ($uid->{'text'} =~ /@/)) { my $address = $uid->{'text'}; $address =~ s/.*<(.*)>.*/$1/; - if (ask("Send signature for $uid->{'text'} to '$address'?", 1, $CONFIG{'mail'})) { + if (ask("Mail signature for $uid->{'text'} to '$address'?", 1, $CONFIG{'mail'})) { my $mail = send_mail($address, $can_encrypt, $longkeyid, $uid, @attached); my $keydir = "$KEYSBASE/$DATE_STRING";