From db6bfb2de1254e28b192855beb1201e50d2504e1 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 3 Mar 2013 23:55:10 +0200 Subject: [PATCH] [PATCH v2 6/6] cli: add top level --config=FILE option --- 48/20a3cba2984389a643898a3494a30223672a6a | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 48/20a3cba2984389a643898a3494a30223672a6a diff --git a/48/20a3cba2984389a643898a3494a30223672a6a b/48/20a3cba2984389a643898a3494a30223672a6a new file mode 100644 index 000000000..f8e53bf1e --- /dev/null +++ b/48/20a3cba2984389a643898a3494a30223672a6a @@ -0,0 +1,106 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 7CACE431FC7 + for ; Sun, 3 Mar 2013 13:55:50 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id CiQXr3mL2ws4 for ; + Sun, 3 Mar 2013 13:55:50 -0800 (PST) +Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com + [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 9AB42429E33 + for ; Sun, 3 Mar 2013 13:55:32 -0800 (PST) +Received: by mail-lb0-f181.google.com with SMTP id gm6so3413461lbb.26 + for ; Sun, 03 Mar 2013 13:55:29 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to + :references:in-reply-to:references:x-gm-message-state; + bh=gc4zUH5wI6IzenxhDROcBrfY2sMFRXwZtQckaJyV+A0=; + b=E35GF0Tx5yFCNHlMfQirowSwnE8KAPdPAWeQ9XuQ8C5o7NDqzQDAlJ2yBWAKCXQFa/ + h3oP9p3lMEHZkEHptBiuhbfjlDnSQ42mwSe7nuA+5Bv0ua43yIvThYOT/Rl+fM9Dg03g + yrmoQQ8JV737DOMtMPArNUIlFwsy79WzSd5GgXRUgJFzHVz9/WqH6ZVLPGQ7xlQzEuga + LFsv7bx/7K5JvnSDlUaUHsMBmjD1EF8kvQWl9t9puwZrgxk4x6QGZ5KWQDp9OVZiZNDL + DZkxACCrbbVQ4mKGuA5thp8ne65XRQaGmRMBa4xg0xbC57DNYH6rmVcRlurCZET6/9/c + d45Q== +X-Received: by 10.112.50.169 with SMTP id d9mr3603525lbo.57.1362347729653; + Sun, 03 Mar 2013 13:55:29 -0800 (PST) +Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi. + [80.223.81.27]) + by mx.google.com with ESMTPS id pk1sm10735446lab.0.2013.03.03.13.55.28 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 03 Mar 2013 13:55:28 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v2 6/6] cli: add top level --config=FILE option +Date: Sun, 3 Mar 2013 23:55:10 +0200 +Message-Id: + <8e1f0e7ba278219d54a3177a50fe84dc8755db6d.1362347362.git.jani@nikula.org> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: +References: +In-Reply-To: +References: +X-Gm-Message-State: + ALoCoQm0UJpmj62D6s0JX6lJ+qvRZg6b7gA1FnEW8y+gxbZrzW5ibBebebHOIORSX3wXkzhsy9lf +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 03 Mar 2013 21:55:50 -0000 + +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 3241e23..f51a84f 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 + -- 2.26.2