+
+ if (opt_index < argc) {
+ query_str = query_string_from_args (notmuch, argc-opt_index, argv+opt_index);
+ if (query_str == NULL) {
+ fprintf (stderr, "Out of memory.\n");
+ return 1;
+ }
+ }
+
+ query = notmuch_query_create (notmuch, query_str);
+ if (query == NULL) {
+ fprintf (stderr, "Out of memory\n");
+ return 1;
+ }
+ /* Don't ask xapian to sort by Message-ID. Xapian optimizes returning the
+ * first results quickly at the expense of total time.
+ */
+ notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
+