> > This sounds something like what Freddie ran into: > > > https://lists.berlios.de/pipermail/openocd-development/2009-December/013817.html > > https://lists.berlios.de/pipermail/openocd-development/2009-December/013860.html > > I think this needs to be improved before 0.4 ships; it's > rather obviously broken, and people didn't have reasons > to complain about such stuff previously. > > Definitely the same thing. I found the bug and attached the patch. Turns out that the usage/help commands only supported single commands like 'reset' or 'init' but not anything like 'nand drivers'. This may not be the best way to build the string from the command's arguments, but suggestions are welcome :).
-- // Dean Glazeski
From e062290b5828ab5cb3e2ce5f9a0b5e6a8b8e6aa2 Mon Sep 17 00:00:00 2001 From: Dean Glazeski <dngl...@gmail.com> Date: Thu, 31 Dec 2009 16:01:32 -0600 Subject: [PATCH] Fix usage/help search for subcommands. This makes it so that the usage/help command properly uses the whole command, including subcommand, in the search for help information. This previously caused erroneous output from the usage command handler. --- src/helper/command.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/helper/command.c b/src/helper/command.c index b991544..50a537b 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -962,12 +962,21 @@ COMMAND_HANDLER(handle_help_command) struct command *c = CMD_CTX->commands; - const char *match = ""; + char *match = NULL; + char *prev = NULL; if (CMD_ARGC == 0) match = ""; - else if (CMD_ARGC == 1) - match = CMD_ARGV[0]; - else + else if (CMD_ARGC >= 1) { + unsigned i; + for (i = 0; i < CMD_ARGC; ++i) { + if (NULL != match) { + prev = match; + match = alloc_printf("%s %s", match, CMD_ARGV[i]); + free(prev); + } else + match = alloc_printf("%s", CMD_ARGV[i]); + } + } else return ERROR_COMMAND_SYNTAX_ERROR; return CALL_COMMAND_HANDLER(command_help_show_list, c, 0, full, match); -- 1.6.5.2
_______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development