Patchworkβ [4/4] Prompt for database location in notmuch setup

login
register
about
Submitter David Benjamin
Date 2010-02-24 02:23:03
Message ID <1266978183-19698-5-git-send-email-davidben@mit.edu>
Download mbox | patch
Permalink /patch/387/
State New
Headers show

Comments

David Benjamin - 2010-02-24 02:23:03
Signed-off-by: David Benjamin <davidben@mit.edu>
---
 notmuch-setup.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/notmuch-setup.c b/notmuch-setup.c
index 622bbaa..e3c8465 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -159,6 +159,15 @@  notmuch_setup_command (unused (void *ctx),
 	notmuch_config_set_database_path (config, absolute_path);
     }
 
+    prompt ("Location for notmuch database [%s]: ",
+	    notmuch_config_get_database_notmuch_path (config));
+    if (strlen (response)) {
+	const char *absolute_path;
+
+	absolute_path = make_path_absolute (ctx, response);
+	notmuch_config_set_database_notmuch_path (config, absolute_path);
+    }
+
     if (! notmuch_config_save (config)) {
 	if (is_new)
 	  welcome_message_post_setup ();