]> git.cworth.org Git - notmuch/blobdiff - notmuch-dump.c
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / notmuch-dump.c
index d701792990f612134a7e2f72e485844f8b2fd1fa..cb82d61fe424176f4a902194cd48a9858939aab7 100644 (file)
@@ -232,11 +232,12 @@ database_dump_file (notmuch_database_t *notmuch, gzFile output,
     if (! query_str)
        query_str = "";
 
-    query = notmuch_query_create (notmuch, query_str);
-    if (query == NULL) {
-       fprintf (stderr, "Out of memory\n");
+    status = notmuch_query_create_with_syntax (notmuch, query_str,
+                                              shared_option_query_syntax (),
+                                              &query);
+    if (print_status_database ("notmuch dump", notmuch, status))
        return EXIT_FAILURE;
-    }
+
     /* Don't ask xapian to sort by Message-ID. Xapian optimizes returning the
      * first results quickly at the expense of total time.
      */
@@ -339,7 +340,7 @@ notmuch_database_dump (notmuch_database_t *notmuch,
        output = NULL;
        goto DONE;
     } else
-        output = NULL;
+       output = NULL;
 
     if (output_file_name) {
        ret = rename (tempname, output_file_name);
@@ -361,13 +362,11 @@ notmuch_database_dump (notmuch_database_t *notmuch,
 }
 
 int
-notmuch_dump_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch , int argc, char *argv[])
+notmuch_dump_command (notmuch_database_t *notmuch, int argc, char *argv[])
 {
     const char *query_str = NULL;
     int ret;
 
-    notmuch_exit_if_unmatched_db_uuid (notmuch);
-
     const char *output_file_name = NULL;
     int opt_index;
 
@@ -394,7 +393,7 @@ notmuch_dump_command (unused(notmuch_config_t *config), notmuch_database_t *notm
     if (opt_index < 0)
        return EXIT_FAILURE;
 
-    notmuch_process_shared_options (argv[0]);
+    notmuch_process_shared_options (notmuch, argv[0]);
 
     if (include == 0)
        include = DUMP_INCLUDE_CONFIG | DUMP_INCLUDE_TAGS | DUMP_INCLUDE_PROPERTIES;