Page MenuHome GnuPG

gpg --recv-key return code is 0
Closed, WontfixPublic

Description

When missing key argument gpg returns error code 0, as if key was received successfully, but it not received for real.
I belive when argument is missing, gpg should return some non-zero error code.
Please, update gpg to return error code when argument is missing.

Now:

gpg --recv-key; echo $?
0

Should be:

gpg --recv-key; echo $?
1

Details

Version
2.4.4

Event Timeline

werner claimed this task.
werner added projects: gnupg, Not A Bug.
werner added a subscriber: werner.

It could have been discussed whether this makes sense. However, we can't change it anymore because it would change the behaviour. Consider a cron job which looks into a directory with keyids and imports them from a keyserver. It is totally fine if the script returns success if no keys are available.