X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-count.c;h=50b0c193f04625c794b9ab9287ab6bdd9c4f29da;hp=493be30f07bb2d93d0beae2af01d7cee3b956c62;hb=e1b7d32db00ea8afaa1f2ae31bdaa5cb423dda96;hpb=5ce8e0b11b40f733e6231d2067764e76717a341a diff --git a/notmuch-count.c b/notmuch-count.c index 493be30f..50b0c193 100644 --- a/notmuch-count.c +++ b/notmuch-count.c @@ -87,8 +87,13 @@ print_count (notmuch_database_t *notmuch, const char *query_str, return -1; } - for (i = 0; i < exclude_tags_length; i++) - notmuch_query_add_tag_exclude (query, exclude_tags[i]); + for (i = 0; i < exclude_tags_length; i++) { + status = notmuch_query_add_tag_exclude (query, exclude_tags[i]); + if (status && status != NOTMUCH_STATUS_IGNORED) { + print_status_query ("notmuch count", query, status); + return -1; + } + } switch (output) { case OUTPUT_MESSAGES: @@ -98,7 +103,7 @@ print_count (notmuch_database_t *notmuch, const char *query_str, printf ("%u", ucount); break; case OUTPUT_THREADS: - status = notmuch_query_count_threads_st (query, &ucount); + status = notmuch_query_count_threads (query, &ucount); if (print_status_query ("notmuch count", query, status)) return -1; printf ("%u", ucount); @@ -106,7 +111,7 @@ print_count (notmuch_database_t *notmuch, const char *query_str, case OUTPUT_FILES: count = count_files (query); if (count >= 0) { - printf ("%u", count); + printf ("%d", count); } else { ret = -1; goto DONE;