From 5bdb8549f619bbcd9fcd6161749dabbb1710dab9 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 20 Oct 2017 22:25:44 -0400 Subject: cli: set up shared command-line arguments for indexing We have an indexopts structure for manipulating indexing in different ways, but we also have three command-line invocations that can trigger indexing: new, insert, and reindex. This changeset prepares a common parser that these subcommands can share. Note: if the deprecated crypto.gpg_path configuration option is set to anything other than "gpg", we ignore it (and print a warning on stderr, if built against gmime < 3.0). At the moment, it's just --try-decrypt, but others will likely follow. --- notmuch-client.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'notmuch-client.h') diff --git a/notmuch-client.h b/notmuch-client.h index d17cdf01..f7524e59 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -495,4 +495,18 @@ void notmuch_exit_if_unmatched_db_uuid (notmuch_database_t *notmuch); void notmuch_process_shared_options (const char* subcommand_name); int notmuch_minimal_options (const char* subcommand_name, int argc, char **argv); + + +/* the state chosen by the user invoking one of the notmuch + * subcommands that does indexing */ +struct _notmuch_client_indexing_cli_choices { + bool try_decrypt; + bool try_decrypt_set; + notmuch_indexopts_t * opts; +}; +extern struct _notmuch_client_indexing_cli_choices indexing_cli_choices; +extern const notmuch_opt_desc_t notmuch_shared_indexing_options []; +notmuch_status_t +notmuch_process_shared_indexing_options (notmuch_database_t *notmuch, notmuch_config_t *config); + #endif -- cgit v1.2.3