+
+ fprintf (stderr, "Use \"notmuch help <command>\" for more details on each command.\n\n");
+}
+
+static int
+help_command (int argc, char *argv[])
+{
+ command_t *command;
+ unsigned int i;
+
+ if (argc == 0) {
+ fprintf (stderr, "The notmuch mail system.\n\n");
+ usage ();
+ return 0;
+ }
+
+ for (i = 0; i < ARRAY_SIZE (commands); i++) {
+ command = &commands[i];
+
+ if (strcmp (argv[0], command->name) == 0) {
+ fprintf (stderr, "Help for \"notmuch %s\":\n\n", argv[0]);
+ fprintf (stderr, "\t%s\t%s\n\n%s\n\n", command->name,
+ command->summary, command->documentation);
+ return 0;
+ }
+ }
+
+ fprintf (stderr,
+ "\nSorry, %s is not a known command. There's not much I can do to help.\n\n",
+ argv[0]);
+ return 1;