diff options
| author | David Bremner <david@tethera.net> | 2021-08-24 08:17:42 -0700 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-09-04 17:07:19 -0700 |
| commit | a2e7af5b6986bca5a2bb2752f892cb86a9767b3c (patch) | |
| tree | dca54e6a7f0a141167e6530813f51b15be92f6d2 /notmuch.c | |
| parent | 551254eb76c9bb558078f04f21df1f6089cb03d6 (diff) | |
CLI: move query syntax to shared option
This will allow easy addition of a query syntax option to other subcommands.
Diffstat (limited to 'notmuch.c')
| -rw-r--r-- | notmuch.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -54,14 +54,26 @@ notmuch_exit_if_unmatched_db_uuid (notmuch_database_t *notmuch); static bool print_version = false, print_help = false; static const char *notmuch_requested_db_uuid = NULL; +static int query_syntax = NOTMUCH_QUERY_SYNTAX_XAPIAN; const notmuch_opt_desc_t notmuch_shared_options [] = { { .opt_bool = &print_version, .name = "version" }, { .opt_bool = &print_help, .name = "help" }, { .opt_string = ¬much_requested_db_uuid, .name = "uuid" }, + { .opt_keyword = &query_syntax, .name = "query", .keywords = + (notmuch_keyword_t []){ { "infix", NOTMUCH_QUERY_SYNTAX_XAPIAN }, + { "sexp", NOTMUCH_QUERY_SYNTAX_SEXP }, + { 0, 0 } } }, + { } }; +notmuch_query_syntax_t +shared_option_query_syntax () +{ + return query_syntax; +} + /* any subcommand wanting to support these options should call * inherit notmuch_shared_options and call * notmuch_process_shared_options (notmuch, subcommand_name); |
