[PATCH 09/18] CLI/notmuch: replace use of notmuch_config_get_*

Subject: [PATCH 09/18] CLI/notmuch: replace use of notmuch_config_get_*

Date: Sat, 20 Feb 2021 12:44:39 -0400

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


The notmuch_config_get_{field_name} internal API will be removed in a
subsequent commit.
---
 notmuch.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/notmuch.c b/notmuch.c
index 71482e43..a161f127 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -364,7 +364,7 @@ notmuch_help_command (unused (notmuch_config_t *config), unused(notmuch_database
  */
 static int
 notmuch_command (notmuch_config_t *config,
-		 unused(notmuch_database_t *notmuch),
+		 notmuch_database_t *notmuch,
 		 unused(int argc), unused(char **argv))
 {
     char *db_path;
@@ -378,7 +378,7 @@ notmuch_command (notmuch_config_t *config,
 
     /* Notmuch is already configured, but is there a database? */
     db_path = talloc_asprintf (config, "%s/%s",
-			       notmuch_config_get_database_path (config),
+			       notmuch_config_get (notmuch, NOTMUCH_CONFIG_DATABASE_PATH),
 			       ".notmuch");
     if (stat (db_path, &st)) {
 	if (errno != ENOENT) {
@@ -409,8 +409,8 @@ notmuch_command (notmuch_config_t *config,
 	    "or any other interface described at https://notmuchmail.org\n\n"
 	    "And don't forget to run \"notmuch new\" whenever new mail arrives.\n\n"
 	    "Have fun, and may your inbox never have much mail.\n\n",
-	    notmuch_config_get_user_name (config),
-	    notmuch_config_get_user_primary_email (config));
+	    notmuch_config_get (notmuch, NOTMUCH_CONFIG_USER_NAME),
+	    notmuch_config_get (notmuch, NOTMUCH_CONFIG_PRIMARY_EMAIL));
 
     return EXIT_SUCCESS;
 }
-- 
2.30.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: