From 6c5f66f12a284b0098ddaf8a8d7e8d352c78ce7c Mon Sep 17 00:00:00 2001 From: Pieter Praet Date: Sun, 19 Feb 2012 21:47:53 +0100 Subject: [PATCH] [PATCH 3/6] cli: add '--debug' option to 'notmuch new' --- cb/c41fe18e5574eed308d2174a9bd344613b3246 | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 cb/c41fe18e5574eed308d2174a9bd344613b3246 diff --git a/cb/c41fe18e5574eed308d2174a9bd344613b3246 b/cb/c41fe18e5574eed308d2174a9bd344613b3246 new file mode 100644 index 000000000..4bbb1767a --- /dev/null +++ b/cb/c41fe18e5574eed308d2174a9bd344613b3246 @@ -0,0 +1,105 @@ +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 3DDFE431FAF + for ; Sun, 19 Feb 2012 12:50:31 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +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 hNpfyowkLytJ for ; + Sun, 19 Feb 2012 12:50:30 -0800 (PST) +Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com + [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id CA00B431FC9 + for ; Sun, 19 Feb 2012 12:50:26 -0800 (PST) +Received: by wibhi8 with SMTP id hi8so3110550wib.26 + for ; Sun, 19 Feb 2012 12:50:25 -0800 (PST) +Received-SPF: pass (google.com: domain of pieter@praet.org designates + 10.180.78.6 as permitted sender) client-ip=10.180.78.6; +Authentication-Results: mr.google.com; + spf=pass (google.com: domain of pieter@praet.org + designates 10.180.78.6 as permitted sender) + smtp.mail=pieter@praet.org +Received: from mr.google.com ([10.180.78.6]) + by 10.180.78.6 with SMTP id x6mr13019112wiw.18.1329684625631 (num_hops + = 1); Sun, 19 Feb 2012 12:50:25 -0800 (PST) +MIME-Version: 1.0 +Received: by 10.180.78.6 with SMTP id x6mr10905637wiw.18.1329684625571; + Sun, 19 Feb 2012 12:50:25 -0800 (PST) +Received: from localhost (104.218-242-81.adsl-dyn.isp.belgacom.be. + [81.242.218.104]) + by mx.google.com with ESMTPS id by3sm11445932wib.3.2012.02.19.12.50.24 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 19 Feb 2012 12:50:25 -0800 (PST) +From: Pieter Praet +To: David Bremner , + Tomi Ollila +Subject: [PATCH 3/6] cli: add '--debug' option to 'notmuch new' +Date: Sun, 19 Feb 2012 21:47:53 +0100 +Message-Id: <1329684476-9596-4-git-send-email-pieter@praet.org> +X-Mailer: git-send-email 1.7.8.1 +In-Reply-To: <1329684476-9596-1-git-send-email-pieter@praet.org> +References: <8739a93beq.fsf@zancas.localnet> + <1329684476-9596-1-git-send-email-pieter@praet.org> +X-Gm-Message-State: + ALoCoQn6tIBonvqKcHsnVWzVq5yao468MV/va7Raplm8ODM66g/JOxp6s3owzkIs4Uk69SxBt/oC +Cc: Notmuch Mail +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, 19 Feb 2012 20:50:31 -0000 + +This will be used in later patches to test the 'new.ignore' +config option more thoroughly. +--- + notmuch-new.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/notmuch-new.c b/notmuch-new.c +index 4f13535..ca12003 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -37,6 +37,7 @@ typedef struct _filename_list { + typedef struct { + int output_is_a_tty; + int verbose; ++ int debug; + const char **new_tags; + size_t new_tags_length; + const char **new_ignore; +@@ -842,6 +843,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) + notmuch_bool_t run_hooks = TRUE; + + add_files_state.verbose = 0; ++ add_files_state.debug = 0; + add_files_state.output_is_a_tty = isatty (fileno (stdout)); + + argc--; argv++; /* skip subcommand argument */ +@@ -849,6 +851,8 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) + for (i = 0; i < argc && argv[i][0] == '-'; i++) { + if (STRNCMP_LITERAL (argv[i], "--verbose") == 0) { + add_files_state.verbose = 1; ++ } else if (strcmp (argv[i], "--debug") == 0) { ++ add_files_state.debug = 1; + } else if (strcmp (argv[i], "--no-hooks") == 0) { + run_hooks = FALSE; + } else { +-- +1.7.8.1 + -- 2.26.2