From 5cb0156504dfa0f09da5649cb741425a09651f6f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 9 Jul 2020 11:24:54 +0200 Subject: [PATCH] gpg: Print a note if no args are given to --delete-key -- It is a bit surprising that nothing happens if no key is specified to --delete-key et al. Although this is common Unix behaviour the use might have expected that it behaves like --export and deletes all keys. Sure we don't do the latter, so a short notice will help. GnuPG-bug-id: 4959 Signed-off-by: Werner Koch --- g10/gpg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/g10/gpg.c b/g10/gpg.c index ac2060930..1dc97a813 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -4437,7 +4437,10 @@ main (int argc, char **argv) case aDeleteSecretKeys: case aDeleteSecretAndPublicKeys: sl = NULL; - /* I'm adding these in reverse order as add_to_strlist2 + /* Print a note if the user did not specify any key. */ + if (!argc && !opt.quiet) + log_info (_("Note: %s\n"), gpg_strerror (GPG_ERR_NO_KEY)); + /* I'm adding these in reverse order as add_to_strlist2 reverses them again, and it's easier to understand in the proper order :) */ for( ; argc; argc-- )