[PATCH 2/2] cli: add support for notmuch command --help
authorJani Nikula <jani@nikula.org>
Sun, 8 Mar 2015 16:18:55 +0000 (18:18 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:48:23 +0000 (14:48 -0700)
f7/d1ed12802aba4009356febd53cf4a9ffe8b541 [new file with mode: 0644]

diff --git a/f7/d1ed12802aba4009356febd53cf4a9ffe8b541 b/f7/d1ed12802aba4009356febd53cf4a9ffe8b541
new file mode 100644 (file)
index 0000000..83a2939
--- /dev/null
@@ -0,0 +1,95 @@
+Return-Path: <jani@nikula.org>\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 A4839431FD9\r
+       for <notmuch@notmuchmail.org>; Sun,  8 Mar 2015 09:18:47 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.738\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.738 tagged_above=-999 required=5\r
+       tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_LOW=-0.7]\r
+       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 n6m7GNhMb4bQ for <notmuch@notmuchmail.org>;\r
+       Sun,  8 Mar 2015 09:18:44 -0700 (PDT)\r
+Received: from mail-we0-f171.google.com (mail-we0-f171.google.com\r
+       [74.125.82.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 44837431FBD\r
+       for <notmuch@notmuchmail.org>; Sun,  8 Mar 2015 09:18:44 -0700 (PDT)\r
+Received: by wesw62 with SMTP id w62so6316149wes.0\r
+       for <notmuch@notmuchmail.org>; Sun, 08 Mar 2015 09:18:43 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references;\r
+       bh=42rGcw44qdL8cCU5YS4fALBEZVdfowo2nTW0Vvih5J4=;\r
+       b=US6wo09fsWO+kdA8qPb1b0WqDhCevwu7wwG2Mh1QSZ/sLM70gHIIV+fPThV9zDIlfi\r
+       rytPTjMUE7qJHHMKZePxtb8AKCQG+65soXfn8iZr6BqwNkOgFAynWuOWdk2VZD9BswgA\r
+       /CxpoqAvLhShrZrbdhIYXHJFDvBnD8ZlZQlxQOYNmJ3H+2Njdy6+oYlgduHWF6N/D5VQ\r
+       EjcfdA9En7Ozjh6vI2EmqY13PYRq+gr6XFXsPL3pP85IAt7vuSZC3uNquK+WAiiASeiG\r
+       wMMaHY4q95vUgR4TJGzyHvxRrP0FuK0g/h6QM1yGXqY5sWBsML2OEPsgEmCWgMPXyjIb\r
+       EbSQ==\r
+X-Gm-Message-State:\r
+ ALoCoQmai43zbgH8Xo+GIhu66rE3FTzTxL/nXrj9YMBwq/yGQtcHWqfscKc390IVtHVbWFNuJ/lH\r
+X-Received: by 10.194.223.103 with SMTP id qt7mr47474148wjc.35.1425831523269; \r
+       Sun, 08 Mar 2015 09:18:43 -0700 (PDT)\r
+Received: from localhost (mobile-internet-bcee3b-76.dhcp.inet.fi.\r
+       [188.238.59.76]) by mx.google.com with ESMTPSA id\r
+       y14sm24336045wjr.39.2015.03.08.09.18.40\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Sun, 08 Mar 2015 09:18:41 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] cli: add support for notmuch command --help\r
+Date: Sun,  8 Mar 2015 18:18:55 +0200\r
+Message-Id: <1425831535-15920-2-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1425831535-15920-1-git-send-email-jani@nikula.org>\r
+References: <1425831535-15920-1-git-send-email-jani@nikula.org>\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: Sun, 08 Mar 2015 16:18:47 -0000\r
+\r
+Recognize 'notmuch command --help' at the top level as a special case,\r
+and show help for the command. Note that for simplicity, --help is\r
+only recognized as the first option for the subcommand.\r
+\r
+---\r
+\r
+Creeping featurism or useful? ISTR Mark wanted this.\r
+---\r
+ notmuch.c | 4 +++-\r
+ 1 file changed, 3 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/notmuch.c b/notmuch.c\r
+index 1717e8b3683c..a5b2877aee09 100644\r
+--- a/notmuch.c\r
++++ b/notmuch.c\r
+@@ -314,7 +314,9 @@ main (int argc, char *argv[])\r
+       goto DONE;\r
+     }\r
\r
+-    if (print_help) {\r
++    /* Handle notmuch --help [command] and notmuch command --help. */\r
++    if (print_help ||\r
++      (opt_index + 1 < argc && strcmp (argv[opt_index + 1], "--help") == 0)) {\r
+       /*\r
+        * Pass the first positional argument as argv[1] so the help\r
+        * command can give help for it. The help command ignores the\r
+-- \r
+2.1.4\r
+\r