--- /dev/null
+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 ED93D431FC0\r
+ for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 06:07:09 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[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 SmUKr+gsOGpF for <notmuch@notmuchmail.org>;\r
+ Sat, 22 Mar 2014 06:07:04 -0700 (PDT)\r
+Received: from mail-la0-f48.google.com (mail-la0-f48.google.com\r
+ [209.85.215.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 3203B431FBC\r
+ for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 06:07:04 -0700 (PDT)\r
+Received: by mail-la0-f48.google.com with SMTP id gf5so2447959lab.35\r
+ for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 06:07:02 -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;\r
+ bh=NDk1WekWTEbvd4u0kvdCwekVPVeDvt3wQJVAiRVHUAc=;\r
+ b=b+qJx2t+r45Ht1zPlFPw70bXDv4cGr1zyEzYlYieWvTlMrooetfAMAjit7hM5UV3dx\r
+ zJL+fInTAPwa6BJlEOzYNAXO/Parlwwq+ZsS8p/j6Tec5keBlp+rSakB3H1Rurbe7804\r
+ U+Drf166d8Ty/bjxTnOPjzCYd3iB6eBPu5q8q10+hqGtjZsS7V+jDtylUoN63t8vJQtK\r
+ fb5Q0BSE7BAzoCpn7PjDGg+lSjqLVFScP5jFkL0ODvL8EFuv/bY0XdjbiPdCJ/c5Naqx\r
+ 4++PS7RFu1bGev2ePciANJZ4ubpSuUtv95wI4ujugA2T/nBm9wQl5ZDV3cckGh1dwx7M\r
+ TrNQ==\r
+X-Gm-Message-State:\r
+ ALoCoQluvm0YVlcms9cqZcy+Wk8Fft8FksocQr/DVcowvb05KzGaL6VZhtj97Og3gEtwglhxBINt\r
+X-Received: by 10.112.47.3 with SMTP id z3mr1543737lbm.34.1395493621302;\r
+ Sat, 22 Mar 2014 06:07:01 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+ [88.195.111.91])\r
+ by mx.google.com with ESMTPSA id z10sm5383516lbu.1.2014.03.22.06.06.59\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sat, 22 Mar 2014 06:07:00 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] cli: fix notmuch help additional topics\r
+Date: Sat, 22 Mar 2014 15:06:58 +0200\r
+Message-Id: <1395493618-29168-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.9.0\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: Sat, 22 Mar 2014 13:07:10 -0000\r
+\r
+The help for hooks was missing.\r
+---\r
+ notmuch.c | 40 +++++++++++++++++++++++++++++++++-------\r
+ 1 file changed, 33 insertions(+), 7 deletions(-)\r
+\r
+diff --git a/notmuch.c b/notmuch.c\r
+index b3fa9f378545..dcda0392a094 100644\r
+--- a/notmuch.c\r
++++ b/notmuch.c\r
+@@ -74,6 +74,18 @@ static command_t commands[] = {\r
+ "This message, or more detailed help for the named command." }\r
+ };\r
+ \r
++typedef struct help_topic {\r
++ const char *name;\r
++ const char *summary;\r
++} help_topic_t;\r
++\r
++static help_topic_t help_topics[] = {\r
++ { "search-terms",\r
++ "Common search term syntax." },\r
++ { "hooks",\r
++ "Hooks that will be run before or after certain commands." },\r
++};\r
++\r
+ static command_t *\r
+ find_command (const char *name)\r
+ {\r
+@@ -93,6 +105,7 @@ static void\r
+ usage (FILE *out)\r
+ {\r
+ command_t *command;\r
++ help_topic_t *topic;\r
+ unsigned int i;\r
+ \r
+ fprintf (out,\r
+@@ -107,13 +120,22 @@ usage (FILE *out)\r
+ command = &commands[i];\r
+ \r
+ if (command->name)\r
+- fprintf (out, " %-11s %s\n", command->name, command->summary);\r
++ fprintf (out, " %-12s %s\n", command->name, command->summary);\r
++ }\r
++\r
++ fprintf (out, "\n");\r
++ fprintf (out, "Additional help topics are as follows:\n");\r
++ fprintf (out, "\n");\r
++\r
++ for (i = 0; i < ARRAY_SIZE (help_topics); i++) {\r
++ topic = &help_topics[i];\r
++ fprintf (out, " %-12s %s\n", topic->name, topic->summary);\r
+ }\r
+ \r
+ fprintf (out, "\n");\r
+ fprintf (out,\r
+- "Use \"notmuch help <command>\" for more details on each command\n"\r
+- "and \"notmuch help search-terms\" for the common search-terms syntax.\n\n");\r
++ "Use \"notmuch help <command or topic>\" for more details "\r
++ "on each command or topic.\n\n");\r
+ }\r
+ \r
+ void\r
+@@ -156,6 +178,8 @@ static int\r
+ notmuch_help_command (notmuch_config_t *config, int argc, char *argv[])\r
+ {\r
+ command_t *command;\r
++ help_topic_t *topic;\r
++ unsigned int i;\r
+ \r
+ argc--; argv++; /* Ignore "help" */\r
+ \r
+@@ -180,10 +204,12 @@ notmuch_help_command (notmuch_config_t *config, int argc, char *argv[])\r
+ exec_man (page);\r
+ }\r
+ \r
+- if (strcmp (argv[0], "search-terms") == 0) {\r
+- exec_man ("notmuch-search-terms");\r
+- } else if (strcmp (argv[0], "hooks") == 0) {\r
+- exec_man ("notmuch-hooks");\r
++ for (i = 0; i < ARRAY_SIZE (help_topics); i++) {\r
++ topic = &help_topics[i];\r
++ if (strcmp (argv[0], topic->name) == 0) {\r
++ char *page = talloc_asprintf (config, "notmuch-%s", topic->name);\r
++ exec_man (page);\r
++ }\r
+ }\r
+ \r
+ fprintf (stderr,\r
+-- \r
+1.9.0\r
+\r