aboutsummaryrefslogtreecommitdiff
path: root/notmuch-insert.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-06-12 10:26:17 -0300
committerDavid Bremner <david@tethera.net>2021-10-23 09:51:50 -0300
commit2ce6c76a61c907b5d1d508e12255e83d9256937c (patch)
treefcb1e35acb341eeaccfdd387fe214b5ba8dab9e6 /notmuch-insert.c
parentc128c995bc3e7474d4086af7e2066f60f54329b2 (diff)
CLI: move indexopts variable out of shared options block
This reduces the amount of global state. Furthermore, index options can be set (in principle) in several ways, not just in the one function for processing indexing command line options.
Diffstat (limited to 'notmuch-insert.c')
-rw-r--r--notmuch-insert.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/notmuch-insert.c b/notmuch-insert.c
index 72e2e35f..214d4d03 100644
--- a/notmuch-insert.c
+++ b/notmuch-insert.c
@@ -461,6 +461,8 @@ notmuch_insert_command (notmuch_database_t *notmuch, int argc, char *argv[])
char *maildir;
char *newpath;
int opt_index;
+ notmuch_indexopts_t *indexopts = notmuch_database_get_default_indexopts (notmuch);
+
void *local = talloc_new (NULL);
notmuch_opt_desc_t options[] = {
@@ -550,7 +552,7 @@ notmuch_insert_command (notmuch_database_t *notmuch, int argc, char *argv[])
return EXIT_FAILURE;
}
- status = notmuch_process_shared_indexing_options (notmuch);
+ status = notmuch_process_shared_indexing_options (indexopts);
if (status != NOTMUCH_STATUS_SUCCESS) {
fprintf (stderr, "Error: Failed to process index options. (%s)\n",
notmuch_status_to_string (status));
@@ -558,7 +560,7 @@ notmuch_insert_command (notmuch_database_t *notmuch, int argc, char *argv[])
}
/* Index the message. */
- status = add_file (notmuch, newpath, tag_ops, synchronize_flags, keep, indexing_cli_choices.opts);
+ status = add_file (notmuch, newpath, tag_ops, synchronize_flags, keep, indexopts);
/* Commit changes. */
close_status = notmuch_database_close (notmuch);