aboutsummaryrefslogtreecommitdiff
path: root/notmuch-reply.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-12-19 11:40:55 -0500
committerDavid Bremner <david@tethera.net>2017-12-29 16:45:55 -0400
commitaf8255fb7159652a7d4e1fe4f1398302e1746cce (patch)
tree7dc9ac3bc7b94d7ee2aa67a29d756b954af576c0 /notmuch-reply.c
parent8ea4a99d74737929f58568505e41c94f65a14743 (diff)
cli/reply: make --decrypt take a keyword
This brings the --decrypt argument to "notmuch reply" into line with the other --decrypt arguments (in "show", "new", "insert", and "reindex"). This patch is really just about bringing consistency to the user interface. We also use the recommended form in the emacs MUA when replying, and update test T350 to match.
Diffstat (limited to 'notmuch-reply.c')
-rw-r--r--notmuch-reply.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 5cdf642b..75cf7ecb 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -704,8 +704,6 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
};
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 =
@@ -719,7 +717,12 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
(notmuch_keyword_t []){ { "all", true },
{ "sender", false },
{ 0, 0 } } },
- { .opt_bool = &decrypt, .name = "decrypt", .present = &decrypt_set },
+ { .opt_keyword = (int*)(&params.crypto.decrypt), .name = "decrypt",
+ .keyword_no_arg_value = "true", .keywords =
+ (notmuch_keyword_t []){ { "false", NOTMUCH_DECRYPT_FALSE },
+ { "auto", NOTMUCH_DECRYPT_AUTO },
+ { "true", NOTMUCH_DECRYPT_NOSTASH },
+ { 0, 0 } } },
{ .opt_inherit = notmuch_shared_options },
{ }
};
@@ -729,8 +732,6 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
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 ();