This will allow "notmuch help" to work for arbitrary external commands
and for any added non-command topics (such as notmuch-sexp-queries).
static int
_help_for (const char *topic_name)
{
static int
_help_for (const char *topic_name)
{
- const command_t *command;
- const help_topic_t *topic;
- unsigned int i;
if (! topic_name) {
printf ("The notmuch mail system.\n\n");
if (! topic_name) {
printf ("The notmuch mail system.\n\n");
- command = find_command (topic_name);
- if (command) {
- char *page = talloc_asprintf (NULL, "notmuch-%s", command->name);
- exec_man (page);
- }
-
- for (i = 0; i < ARRAY_SIZE (help_topics); i++) {
- topic = &help_topics[i];
- if (strcmp (topic_name, topic->name) == 0) {
- char *page = talloc_asprintf (NULL, "notmuch-%s", topic->name);
- exec_man (page);
- }
- }
+ page = talloc_asprintf (NULL, "notmuch-%s", topic_name);
+ exec_man (page);
- fprintf (stderr,
- "\nSorry, %s is not a known command. There's not much I can do to help.\n\n",
- topic_name);