summaryrefslogtreecommitdiffstats
path: root/notmuch-new.c
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2017-10-14 16:16:07 +0300
committerDavid Bremner <david@tethera.net>2017-12-13 08:28:37 -0400
commite29ec5f0e9d36a8ccf335b30554408d4b6cbbc28 (patch)
tree98a91b4ce88fc4af4fa4d970a73bd693f22ad264 /notmuch-new.c
parent39abd3b5226fef99de1adaa2e8f6b1ba8480c5f5 (diff)
cli: use the negating boolean support for new and insert --no-hooks
This lets us use the positive hooks variable in code, increasing clarity.
Diffstat (limited to 'notmuch-new.c')
-rw-r--r--notmuch-new.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index fb021b18..b0a91b0e 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -954,7 +954,7 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
int opt_index;
unsigned int i;
bool timer_is_active = false;
- bool no_hooks = false;
+ bool hooks = true;
bool quiet = false, verbose = false;
notmuch_status_t status;
@@ -962,7 +962,7 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
{ .opt_bool = &quiet, .name = "quiet" },
{ .opt_bool = &verbose, .name = "verbose" },
{ .opt_bool = &add_files_state.debug, .name = "debug" },
- { .opt_bool = &no_hooks, .name = "no-hooks" },
+ { .opt_bool = &hooks, .name = "hooks" },
{ .opt_inherit = notmuch_shared_indexing_options },
{ .opt_inherit = notmuch_shared_options },
{ }
@@ -996,7 +996,7 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
}
}
- if (!no_hooks) {
+ if (hooks) {
ret = notmuch_run_hook (db_path, "pre-new");
if (ret)
return EXIT_FAILURE;
@@ -1168,7 +1168,7 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
notmuch_database_destroy (notmuch);
- if (!no_hooks && !ret && !interrupted)
+ if (hooks && !ret && !interrupted)
ret = notmuch_run_hook (db_path, "post-new");
if (ret || interrupted)