X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-count.c;h=0d9046a8a20835f910ed4ac0dc8447f0e67df069;hp=5ac4292bc495c2cad1107eb74d67f7ce008d7acf;hb=HEAD;hpb=1c747a501c0ed7df5eaa2b994b9ad11d8981c62c diff --git a/notmuch-count.c b/notmuch-count.c index 5ac4292b..0d9046a8 100644 --- a/notmuch-count.c +++ b/notmuch-count.c @@ -74,10 +74,12 @@ print_count (notmuch_database_t *notmuch, const char *query_str, int ret = 0; notmuch_status_t status; - query = notmuch_query_create (notmuch, query_str); - if (query == NULL) { - fprintf (stderr, "Out of memory\n"); - return -1; + status = notmuch_query_create_with_syntax (notmuch, query_str, + shared_option_query_syntax (), + &query); + if (print_status_database ("notmuch count", notmuch, status)) { + ret = -1; + goto DONE; } for (notmuch_config_values_start (exclude_tags); @@ -182,7 +184,7 @@ notmuch_count_command (notmuch_database_t *notmuch, int argc, char *argv[]) if (opt_index < 0) return EXIT_FAILURE; - notmuch_process_shared_options (argv[0]); + notmuch_process_shared_options (notmuch, argv[0]); if (input_file_name) { batch = true; @@ -201,8 +203,6 @@ notmuch_count_command (notmuch_database_t *notmuch, int argc, char *argv[]) return EXIT_FAILURE; } - notmuch_exit_if_unmatched_db_uuid (notmuch); - query_str = query_string_from_args (notmuch, argc - opt_index, argv + opt_index); if (query_str == NULL) { fprintf (stderr, "Out of memory.\n");