aboutsummaryrefslogtreecommitdiff
path: root/notmuch-reply.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-07-01 18:45:47 -0300
committerDavid Bremner <david@tethera.net>2022-07-30 08:45:15 -0300
commit24decfc1dd294b7546da53890f1c4d16105cc8d6 (patch)
tree2b41e264091e358e9d52512e70307dc2b92e41cb /notmuch-reply.c
parent5ea5a5557d9ad4cef67e61a83bb81abd44dc7f76 (diff)
CLI/reply: support --duplicate argument
We want the reply used to match that shown e.g. in the emacs interface. As a first step provide that functionality on the command line. Schema does not need updating as the duplicate key was already present (with a constant value of 1).
Diffstat (limited to 'notmuch-reply.c')
-rw-r--r--notmuch-reply.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 40576f19..44297251 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -663,7 +663,7 @@ do_reply (notmuch_database_t *notmuch,
notmuch_messages_move_to_next (messages)) {
message = notmuch_messages_get (messages);
- if (mime_node_open (notmuch, message, -1, &params->crypto, &node))
+ if (mime_node_open (notmuch, message, params->duplicate, &params->crypto, &node))
return 1;
reply = create_reply_message (notmuch, message,
@@ -683,7 +683,7 @@ do_reply (notmuch_database_t *notmuch,
/* Start the original */
sp->map_key (sp, "original");
- format_part_sprinter (notmuch, sp, node, -1, true, false);
+ format_part_sprinter (notmuch, sp, node, params->duplicate, true, false);
/* End */
sp->end (sp);
@@ -715,6 +715,7 @@ notmuch_reply_command (notmuch_database_t *notmuch, int argc, char *argv[])
int opt_index;
notmuch_show_params_t params = {
.part = -1,
+ .duplicate = 0,
.crypto = { .decrypt = NOTMUCH_DECRYPT_AUTO },
};
int format = FORMAT_DEFAULT;
@@ -739,6 +740,7 @@ notmuch_reply_command (notmuch_database_t *notmuch, int argc, char *argv[])
{ "auto", NOTMUCH_DECRYPT_AUTO },
{ "true", NOTMUCH_DECRYPT_NOSTASH },
{ 0, 0 } } },
+ { .opt_int = &params.duplicate, .name = "duplicate" },
{ .opt_inherit = notmuch_shared_options },
{ }
};