diff --git a/g10/delkey.c b/g10/delkey.c index b89451089..05b9301ee 100644 --- a/g10/delkey.c +++ b/g10/delkey.c @@ -151,7 +151,12 @@ do_delete_key (ctrl_t ctrl, const char *username, int secret, int force, if (opt.batch && exactmatch) - okay++; + { + if (!opt.answer_yes && secret) + log_error(_("can't do this in batch mode without \"--yes\"\n")); + else + okay++; + } else if (opt.batch && secret) { log_error(_("can't do this in batch mode\n"));