X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.c;fp=notmuch.c;h=3fb58bf2e822f606ca9a38e8cbc6aa22422bfd10;hp=3824bf19e07c875d4c1da58d4811330a44fd60d2;hb=a2e7af5b6986bca5a2bb2752f892cb86a9767b3c;hpb=551254eb76c9bb558078f04f21df1f6089cb03d6 diff --git a/notmuch.c b/notmuch.c index 3824bf19..3fb58bf2 100644 --- a/notmuch.c +++ b/notmuch.c @@ -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);