From a0b4389867f570248f418c8fbb869c7d3a3122ca Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 29 Jan 2013 23:46:24 +0200 Subject: [PATCH] [PATCH 6/6] cli: add top level --config=FILE option --- 5b/96e1eb6851192f5a92fd857c7ae07f2e405157 | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 5b/96e1eb6851192f5a92fd857c7ae07f2e405157 diff --git a/5b/96e1eb6851192f5a92fd857c7ae07f2e405157 b/5b/96e1eb6851192f5a92fd857c7ae07f2e405157 new file mode 100644 index 000000000..9f5348f37 --- /dev/null +++ b/5b/96e1eb6851192f5a92fd857c7ae07f2e405157 @@ -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 C1DB9431FC2 + for ; Tue, 29 Jan 2013 13:47:08 -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 p8P25tJoGZBy for ; + Tue, 29 Jan 2013 13:47:08 -0800 (PST) +Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com + [209.85.217.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0E409431FC3 + for ; Tue, 29 Jan 2013 13:47:03 -0800 (PST) +Received: by mail-lb0-f175.google.com with SMTP id n3so1311291lbo.6 + for ; Tue, 29 Jan 2013 13:47:02 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=x-received:from:to:subject:date:message-id:x-mailer:in-reply-to + :references:in-reply-to:references:x-gm-message-state; + bh=zuQO6SOA1CaSVBBXUG/vfJuuMXcuewvzBJ9xEY6kTSU=; + b=mRUdgbSA7C8pIr10ekj7Ncc69cUfOQWsxsa2kaKNIGhhzH8NxTQCFCQmjBTowJpUl+ + ltuLvh+4ojqC2HrjItcS9Z16EhtFI+IMcn2aLldD/s5dl7hE8i/tr+CvZCS5MMC7BzVo + ksHFTBRadwhwz/RE7SymeM3hVV/9PGoyE1YIcP/UbeoCrljCFwsudlzq5/+F63yf7boh + YsCkOopyeuM1U7naOTQ+0u+WIdK5QamqT4YtYzpSYP19nyl66H9aYXYbDhJMhKKpeZsP + 8+dIuDb+sOfsIu+iDSWb8AihfrwhG2Ki0GwW3xRhcmAT8I8r9kASqRkQSJApuQTlf1RJ + Xgyg== +X-Received: by 10.152.147.36 with SMTP id th4mr2522667lab.19.1359496022562; + Tue, 29 Jan 2013 13:47:02 -0800 (PST) +Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi. + [80.223.81.27]) + by mx.google.com with ESMTPS id f2sm5596970lbz.4.2013.01.29.13.47.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Tue, 29 Jan 2013 13:47:01 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 6/6] cli: add top level --config=FILE option +Date: Tue, 29 Jan 2013 23:46:24 +0200 +Message-Id: + <231895226338fb6b24eea0ffeef565992822aca8.1359495450.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: + ALoCoQl7pwOxno2S+5esqZEpsNTukxhBc9IL46J4B7LFZmood7UmtqTF+GxsuvumLAkFeq26ASML +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: Tue, 29 Jan 2013 21:47:09 -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 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 + -- 2.26.2