From e8384ec7ac2b86cce3c509a1ac35efa2b7bfb380 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Fri, 3 Feb 2017 18:06:57 +0000 Subject: [PATCH] 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. --- tomb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tomb b/tomb index 15ff175..5a76b78 100755 --- a/tomb +++ b/tomb @@ -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"