aboutsummaryrefslogtreecommitdiff
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-12-08 01:23:52 -0500
committerDavid Bremner <david@tethera.net>2017-12-08 08:07:02 -0400
commit798aa789b5d117cf11697bc97dd982bd5a2c2ac8 (patch)
tree0424270f3f7c5c8764ce4301ee2b9c05ffa4531d /notmuch-show.c
parentb62045a18680720b407173140d79b459e45e6039 (diff)
lib: convert notmuch decryption policy to an enum
Future patches in this series will introduce new policies; this merely readies the way for them. We also convert --try-decrypt to a keyword argument instead of a boolean.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index 7afd3947..7ee9685a 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -1083,11 +1083,13 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])
.part = -1,
.omit_excluded = true,
.output_body = true,
+ .crypto = { .decrypt = NOTMUCH_DECRYPT_FALSE },
};
int format = NOTMUCH_FORMAT_NOT_SPECIFIED;
bool exclude = true;
bool entire_thread_set = false;
bool single_message;
+ bool decrypt = false;
notmuch_opt_desc_t options[] = {
{ .opt_keyword = &format, .name = "format", .keywords =
@@ -1102,7 +1104,7 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])
{ .opt_bool = &params.entire_thread, .name = "entire-thread",
.present = &entire_thread_set },
{ .opt_int = &params.part, .name = "part" },
- { .opt_bool = &params.crypto.decrypt, .name = "decrypt" },
+ { .opt_bool = &decrypt, .name = "decrypt" },
{ .opt_bool = &params.crypto.verify, .name = "verify" },
{ .opt_bool = &params.output_body, .name = "body" },
{ .opt_bool = &params.include_html, .name = "include-html" },
@@ -1116,9 +1118,11 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])
notmuch_process_shared_options (argv[0]);
- /* decryption implies verification */
- if (params.crypto.decrypt)
+ if (decrypt) {
+ params.crypto.decrypt = NOTMUCH_DECRYPT_TRUE;
+ /* decryption implies verification */
params.crypto.verify = true;
+ }
/* specifying a part implies single message display */
single_message = params.part >= 0;