diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2017-12-08 01:23:52 -0500 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2017-12-08 08:07:02 -0400 |
commit | 798aa789b5d117cf11697bc97dd982bd5a2c2ac8 (patch) | |
tree | 0424270f3f7c5c8764ce4301ee2b9c05ffa4531d /notmuch-reply.c | |
parent | b62045a18680720b407173140d79b459e45e6039 (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-reply.c')
-rw-r--r-- | notmuch-reply.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c index 2c7cc4eb..eec34bed 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -700,9 +700,11 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) int opt_index; notmuch_show_params_t params = { .part = -1, + .crypto = { .decrypt = NOTMUCH_DECRYPT_FALSE }, }; int format = FORMAT_DEFAULT; int reply_all = true; + bool decrypt = false; notmuch_opt_desc_t options[] = { { .opt_keyword = &format, .name = "format", .keywords = @@ -716,7 +718,7 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) (notmuch_keyword_t []){ { "all", true }, { "sender", false }, { 0, 0 } } }, - { .opt_bool = ¶ms.crypto.decrypt, .name = "decrypt" }, + { .opt_bool = &decrypt, .name = "decrypt" }, { .opt_inherit = notmuch_shared_options }, { } }; @@ -726,6 +728,8 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) return EXIT_FAILURE; notmuch_process_shared_options (argv[0]); + if (decrypt) + params.crypto.decrypt = NOTMUCH_DECRYPT_TRUE; notmuch_exit_if_unsupported_format (); |