[PATCH 0/2] cli: Parsing. Add option NOTMUCH_OPT_INT_OR_BOOLEAN
authorMark Walters <markwalters1009@gmail.com>
Thu, 8 Mar 2012 22:15:42 +0000 (22:15 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:20 +0000 (09:45 -0800)
f6/a4660719dd9bd2fa0ae68886a0325f1dbbf9ff [new file with mode: 0644]

diff --git a/f6/a4660719dd9bd2fa0ae68886a0325f1dbbf9ff b/f6/a4660719dd9bd2fa0ae68886a0325f1dbbf9ff
new file mode 100644 (file)
index 0000000..d1c41ea
--- /dev/null
@@ -0,0 +1,91 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id CD79A431FB6\r
+       for <notmuch@notmuchmail.org>; Thu,  8 Mar 2012 14:15:55 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id sd+QYoEgMUwE for <notmuch@notmuchmail.org>;\r
+       Thu,  8 Mar 2012 14:15:55 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 0BB44431FAE   for <notmuch@notmuchmail.org>; Thu,  8 Mar 2012 14:15:54 -0800\r
+ (PST)\r
+Received: by wgbds10 with SMTP id ds10so878463wgb.2\r
+       for <notmuch@notmuchmail.org>; Thu, 08 Mar 2012 14:15:52 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=9o2iTOi2HIECD8EDfxe2wnqxt31Yq0Xkxg5fAZj7nyM=;\r
+       b=BnhRSoMOSXncumhurbuMbZQbsTSfZ3X0pqy4/GAjpgs3l3njcXImpaqwXUAbUHe8yg\r
+       AbHsA4CvOnJOJwrwcSmsXM76454EOkQB7iOL4ZYpQLNykNjEsWJrCWK9O6J69RS4s7cy\r
+       fumq8h4FKeJaS8mkMIzQ7tTH+WD3TbFKyzLyIfoNzjZOBLrPGHIFxDGmTnYLq9kfx4ms\r
+       CCW9EtiB2otm5CGvrHmaVAX9qUiRPS+jigG1RQTM0tDEesMy73VIpT7nBQNEU+b8OrgV\r
+       mITbGGhlg/AGosh//28CUvNoVHiY2F2C+oO5nmC/qbQAMmQjJTVw7SZfa9FkxNJ0sNs8\r
+       woRA==\r
+Received: by 10.180.106.9 with SMTP id gq9mr16490665wib.17.1331244952365;\r
+       Thu, 08 Mar 2012 14:15:52 -0800 (PST)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ w10sm14906589wiy.3.2012.03.08.14.15.50        (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 08 Mar 2012 14:15:51 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 0/2] cli: Parsing. Add option NOTMUCH_OPT_INT_OR_BOOLEAN\r
+Date: Thu,  8 Mar 2012 22:15:42 +0000\r
+Message-Id: <1331244944-7960-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 08 Mar 2012 22:15:55 -0000\r
+\r
+The first patch adds a new command line parsing option\r
+NOTMUCH_OPT_INT_OR_BOOLEAN for command line parsing which accepts\r
+--verbose=3 and --verbose with the latter setting verbose to 1. It\r
+also allows --verbose=0 so (with a little caller support) the user can\r
+turn off boolean options.\r
+\r
+It also means that extra options can be added to the command line\r
+programs in a backwards compatible manner (e.g. if --verbose already\r
+exists we could add --verbose=2).\r
+\r
+The second patch uses this to make the --entire-thread option to\r
+notmuch-show a NOTMUCH_OPT_INT_OR_BOOLEAN. In particular this allows\r
+the caller to disable --entire-thread (with --entire-thread=0) when\r
+format=json.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+Mark Walters (2):\r
+  cli: Parsing. Add option NOTMUCH_OPT_INT_OR_BOOLEAN\r
+  cli: make --entire-thread option notmuch-show.c INT_OR_BOOLEAN\r
+\r
+ command-line-arguments.c |   29 +++++++++++++++++++++++++++--\r
+ command-line-arguments.h |    3 +++\r
+ notmuch-show.c           |   10 ++++++++--\r
+ 3 files changed, 38 insertions(+), 4 deletions(-)\r
+\r
+-- \r
+1.7.9.1\r
+\r