]> git.cworth.org Git - notmuch/commitdiff
CLI/notmuch: switch notmuch_command to notmuch_config_get
authorDavid Bremner <david@tethera.net>
Tue, 23 Feb 2021 13:22:37 +0000 (09:22 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 27 Mar 2021 12:26:14 +0000 (09:26 -0300)
The goal at this point is to remove the dependence on
notmuch_config_get_* without breaking any existing functionality. This
is a step towards removing notmuch_config_get_* in a future commit.

notmuch.c

index 4132e5617c0e37196ca9a3c7ef2bc19ec575b41c..ff9ad18b5d36ea0fb32dbbd4c52cb967b608e415 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -391,7 +391,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) {
@@ -422,8 +422,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;
 }