X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=notmuch-dump.c;h=a490917f9fa59d5a9a042d0c85030bc7aad42c8e;hb=1c81e8f6d3aa451cec8524c171b9a64f7ecd2003;hp=409c86ada6dd709461da7b20e7732a3a345a3880;hpb=53b397acfcd6b6372372593cc9047ee1a9599afd;p=notmuch diff --git a/notmuch-dump.c b/notmuch-dump.c index 409c86ad..a490917f 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -41,6 +41,8 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) if (notmuch == NULL) return 1; + argc--; argv++; /* skip subcommand argument */ + if (argc && strcmp (argv[0], "--") != 0) { fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n"); output = fopen (argv[0], "w"); @@ -65,13 +67,16 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) return 1; } } - + query = notmuch_query_create (notmuch, query_str); if (query == NULL) { fprintf (stderr, "Out of memory\n"); return 1; } - notmuch_query_set_sort (query, NOTMUCH_SORT_MESSAGE_ID); + /* 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); for (messages = notmuch_query_search_messages (query); notmuch_messages_valid (messages);