diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2017-10-20 22:25:46 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2017-10-21 19:58:32 -0300 |
| commit | 35456d4b0c89c3fa648fb6a879c5d275e04ff1c2 (patch) | |
| tree | 428fe3d6976b2a56f8a79318f5aa6d15a01106cd /notmuch-new.c | |
| parent | 92f318abe40c7e0ef449559728b3a6d160bd9325 (diff) | |
cli/new: add --try-decrypt=(true|false)
Enable override of the index.try_decrypt setting during "notmuch new"
on a per-invocation basis.
We update the documentation and tab completion, and also add a test.
Diffstat (limited to 'notmuch-new.c')
| -rw-r--r-- | notmuch-new.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/notmuch-new.c b/notmuch-new.c index 0f50457e..fb021b18 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -267,7 +267,7 @@ add_file (notmuch_database_t *notmuch, const char *filename, if (status) goto DONE; - status = notmuch_database_index_file (notmuch, filename, NULL, &message); + status = notmuch_database_index_file (notmuch, filename, indexing_cli_choices.opts, &message); switch (status) { /* Success. */ case NOTMUCH_STATUS_SUCCESS: @@ -963,6 +963,7 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[]) { .opt_bool = &verbose, .name = "verbose" }, { .opt_bool = &add_files_state.debug, .name = "debug" }, { .opt_bool = &no_hooks, .name = "no-hooks" }, + { .opt_inherit = notmuch_shared_indexing_options }, { .opt_inherit = notmuch_shared_options }, { } }; @@ -1080,6 +1081,13 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[]) if (notmuch == NULL) return EXIT_FAILURE; + status = notmuch_process_shared_indexing_options (notmuch, config); + if (status != NOTMUCH_STATUS_SUCCESS) { + fprintf (stderr, "Error: Failed to process index options. (%s)\n", + notmuch_status_to_string (status)); + return EXIT_FAILURE; + } + /* Set up our handler for SIGINT. We do this after having * potentially done a database upgrade we this interrupt handler * won't support. */ |
