Allow opening a tomb without giving a valid recipient.

The -r option always requires an arguments. However GPG does not need
any recipient when decrypting a key. In order to be able to open a tomb
without writing (the long) recipient, the user can use the -f option to
short-cut the valid recipient checking. A dummy recipient is still required.
This commit is contained in:
Alexandre Pujol 2017-02-03 18:06:57 +00:00
parent 6f89dbd2fe
commit e8384ec7ac

2
tomb
View File

@ -992,7 +992,7 @@ gpg_decrypt() {
{ option_is_set -r } && {
typeset -a recipients
recipients=(${(s:,:)$(option_value -r)})
{ is_valid_recipients $recipients } || {
{ ! is_valid_recipients $recipients } && { ! option_is_set -f } && {
_failure "You set an invalid GPG ID."
}
gpgpass="$TOMBKEY"