summaryrefslogtreecommitdiffstats
path: root/notmuch-count.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-04-06 07:39:55 +0900
committerDavid Bremner <david@tethera.net>2015-08-14 18:23:49 +0200
commitf76d8f82dd004cf14426a91e8a80dcd2a4b97317 (patch)
treeb2a08fb89242d809d095665a84ff75c6d7d142e3 /notmuch-count.c
parent5a3b42fb8c556397841b86c5fda1c4554dab253a (diff)
cli: add global option "--uuid"
The function notmuch_exit_if_unmatched_db_uuid is split from notmuch_process_shared_options because it needs an open notmuch database. There are two exceptional cases in uuid handling. 1) notmuch config and notmuch setup don't currently open the database, so it doesn't make sense to check the UUID. 2) notmuch compact opens the database inside the library, so we either need to open the database just to check uuid, or change the API.
Diffstat (limited to 'notmuch-count.c')
-rw-r--r--notmuch-count.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/notmuch-count.c b/notmuch-count.c
index 182710a6..f26e726a 100644
--- a/notmuch-count.c
+++ b/notmuch-count.c
@@ -189,6 +189,8 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])
NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch))
return EXIT_FAILURE;
+ notmuch_exit_if_unmatched_db_uuid (notmuch);
+
query_str = query_string_from_args (config, argc-opt_index, argv+opt_index);
if (query_str == NULL) {
fprintf (stderr, "Out of memory.\n");