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-search.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-search.c')
| -rw-r--r-- | notmuch-search.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/notmuch-search.c b/notmuch-search.c index 39d55bfe..327e1445 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -722,7 +722,8 @@ _notmuch_search_prepare (search_context_t *ctx, int argc, char *argv[]) if (print_status_database ("notmuch search", ctx->notmuch, notmuch_query_create_with_syntax (ctx->notmuch, query_str, - ctx->query_syntax, &ctx->query))) + shared_option_query_syntax (), + &ctx->query))) return EXIT_FAILURE; notmuch_query_set_sort (ctx->query, ctx->sort); @@ -788,10 +789,6 @@ static const notmuch_opt_desc_t common_options[] = { { "text", NOTMUCH_FORMAT_TEXT }, { "text0", NOTMUCH_FORMAT_TEXT0 }, { 0, 0 } } }, - { .opt_keyword = &search_context.query_syntax, .name = "query", .keywords = - (notmuch_keyword_t []){ { "infix", NOTMUCH_QUERY_SYNTAX_XAPIAN }, - { "sexp", NOTMUCH_QUERY_SYNTAX_SEXP }, - { 0, 0 } } }, { .opt_int = ¬much_format_version, .name = "format-version" }, { } }; |
