int opt_index;
notmuch_show_params_t params = {
.part = -1,
+ .crypto = { .decrypt = NOTMUCH_DECRYPT_AUTO },
};
int format = FORMAT_DEFAULT;
int reply_all = true;
+ bool decrypt = false;
+ bool decrypt_set = false;
notmuch_opt_desc_t options[] = {
{ .opt_keyword = &format, .name = "format", .keywords =
(notmuch_keyword_t []){ { "all", true },
{ "sender", false },
{ 0, 0 } } },
- { .opt_bool = ¶ms.crypto.decrypt, .name = "decrypt" },
+ { .opt_bool = &decrypt, .name = "decrypt", .present = &decrypt_set },
{ .opt_inherit = notmuch_shared_options },
{ }
};
return EXIT_FAILURE;
notmuch_process_shared_options (argv[0]);
+ if (decrypt_set)
+ params.crypto.decrypt = decrypt ? NOTMUCH_DECRYPT_NOSTASH : NOTMUCH_DECRYPT_FALSE;
notmuch_exit_if_unsupported_format ();
if (do_reply (config, query, ¶ms, format, reply_all) != 0)
return EXIT_FAILURE;
- notmuch_crypto_cleanup (¶ms.crypto);
+ _notmuch_crypto_cleanup (¶ms.crypto);
notmuch_query_destroy (query);
notmuch_database_destroy (notmuch);