[PATCH 6/6] cli: add top level --config=FILE option

2013-01-29 Thread Jani Nikula
Let the user specify the config file on the command line.
---
 notmuch.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/notmuch.c b/notmuch.c
index f4bfeaa..71cd0d6 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;

-- 
1.7.10.4



[PATCH 6/6] cli: add top level --config=FILE option

2013-03-03 Thread David Bremner
Jani Nikula  writes:

> Let the user specify the config file on the command line.
>  
> -config = notmuch_config_open (local, NULL, command->create_config);
> +config = notmuch_config_open (local, config_file_name, 
> command->create_config);
>  if (!config)
>   return 1;

LGTM


[PATCH 6/6] cli: add top level --config=FILE option

2013-01-29 Thread Jani Nikula
Let the user specify the config file on the command line.
---
 notmuch.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/notmuch.c b/notmuch.c
index f4bfeaa..71cd0d6 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;
 
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 6/6] cli: add top level --config=FILE option

2013-03-03 Thread David Bremner
Jani Nikula  writes:

> Let the user specify the config file on the command line.
>  
> -config = notmuch_config_open (local, NULL, command->create_config);
> +config = notmuch_config_open (local, config_file_name, 
> command->create_config);
>  if (!config)
>   return 1;

LGTM
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch