aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2013-03-03 23:55:10 +0200
committerGravatar David Bremner <bremner@debian.org>2013-03-08 07:54:53 -0400
commited016e5670b715aea6750343aea698c38a7e7440 (patch)
tree0212cefff5de3f7c462f08b7547b441b9b3831c3 /notmuch.c
parent4ef2106792439f5ade157b3ba3b8f7fa86fcb3ed (diff)
cli: add top level --config=FILE option
Let the user specify the config file on the command line.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/notmuch.c b/notmuch.c
index 3241e23f..f51a84f5 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -258,6 +258,7 @@ main (int argc, char *argv[])
char *talloc_report;
const char *command_name = NULL;
command_t *command;
+ char *config_file_name = NULL;
notmuch_config_t *config;
notmuch_bool_t print_help=FALSE, print_version=FALSE;
int opt_index;
@@ -266,6 +267,7 @@ main (int argc, char *argv[])
notmuch_opt_desc_t options[] = {
{ NOTMUCH_OPT_BOOLEAN, &print_help, "help", 'h', 0 },
{ NOTMUCH_OPT_BOOLEAN, &print_version, "version", 'v', 0 },
+ { NOTMUCH_OPT_STRING, &config_file_name, "config", 'c', 0 },
{ 0, 0, 0, 0, 0 }
};
@@ -303,7 +305,7 @@ main (int argc, char *argv[])
return 1;
}
- config = notmuch_config_open (local, NULL, command->create_config);
+ config = notmuch_config_open (local, config_file_name, command->create_config);
if (!config)
return 1;