--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 92A2B431FC0\r
+ for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 06:18:10 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\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 9Fw5QPEFoyx0 for <notmuch@notmuchmail.org>;\r
+ Sat, 22 Mar 2014 06:18:03 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 93ACA431FBC\r
+ for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 06:18:03 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 9AC1E100033;\r
+ Sat, 22 Mar 2014 15:17:53 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] cli: fix notmuch help additional topics\r
+In-Reply-To: <1395493618-29168-1-git-send-email-jani@nikula.org>\r
+References: <1395493618-29168-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.17+155~g3416ef5 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Sat, 22 Mar 2014 15:17:53 +0200\r
+Message-ID: <m2r45utlry.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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:18:10 -0000\r
+\r
+On Sat, Mar 22 2014, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> The help for hooks was missing.\r
+>\r
+> ---\r
+\r
+The code changes LGTM.\r
+\r
+Tomi\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
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r