From 0018a8d787a98f80c665061daa9b0c73839d3666 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 5 Apr 2015 22:13:03 +0900 Subject: cli: define shared options, use for --help and --version Unfortunately it seems trickier to support --config globally The non-trivial changes are in notmuch.c; most of the other changes consists of blindly inserting two lines into every subcommand. --- notmuch-count.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'notmuch-count.c') diff --git a/notmuch-count.c b/notmuch-count.c index 6058f7c9..57a88a8d 100644 --- a/notmuch-count.c +++ b/notmuch-count.c @@ -146,6 +146,7 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[]) { 0, 0 } } }, { NOTMUCH_OPT_BOOLEAN, &batch, "batch", 0, 0 }, { NOTMUCH_OPT_STRING, &input_file_name, "input", 'i', 0 }, + { NOTMUCH_OPT_INHERIT, (void *) ¬much_shared_options, NULL, 0, 0 }, { 0, 0, 0, 0, 0 } }; @@ -153,6 +154,8 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[]) if (opt_index < 0) return EXIT_FAILURE; + notmuch_process_shared_options (argv[0]); + if (input_file_name) { batch = TRUE; input = fopen (input_file_name, "r"); -- cgit v1.2.3