.part = -1,
.omit_excluded = true,
.output_body = true,
+ .crypto = { .decrypt = NOTMUCH_DECRYPT_AUTO },
};
int format = NOTMUCH_FORMAT_NOT_SPECIFIED;
bool exclude = true;
bool entire_thread_set = false;
bool single_message;
+ bool decrypt = false;
+ bool decrypt_set = false;
notmuch_opt_desc_t options[] = {
{ .opt_keyword = &format, .name = "format", .keywords =
{ .opt_bool = ¶ms.entire_thread, .name = "entire-thread",
.present = &entire_thread_set },
{ .opt_int = ¶ms.part, .name = "part" },
- { .opt_bool = ¶ms.crypto.decrypt, .name = "decrypt" },
+ { .opt_bool = &decrypt, .name = "decrypt", .present = &decrypt_set },
{ .opt_bool = ¶ms.crypto.verify, .name = "verify" },
{ .opt_bool = ¶ms.output_body, .name = "body" },
{ .opt_bool = ¶ms.include_html, .name = "include-html" },
notmuch_process_shared_options (argv[0]);
- /* decryption implies verification */
- if (params.crypto.decrypt)
- params.crypto.verify = true;
+ if (decrypt_set) {
+ if (decrypt) {
+ /* we do not need or want to ask for session keys */
+ params.crypto.decrypt = NOTMUCH_DECRYPT_NOSTASH;
+ /* decryption implies verification */
+ params.crypto.verify = true;
+ } else {
+ params.crypto.decrypt = NOTMUCH_DECRYPT_FALSE;
+ }
+ }
/* specifying a part implies single message display */
single_message = params.part >= 0;