diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2019-03-28 11:58:10 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2019-05-14 19:39:02 +0100 |
commit | 9eea9cce3f0931d9ecf3977211bd0f189be57c52 (patch) | |
tree | 9bf37640659c29bcf719a5b85f6c57a0f81176ad /src | |
parent | 6da0512092d03bb9ea08df0cafd5d3fbaef432d2 (diff) | |
download | riscv-openocd-9eea9cce3f0931d9ecf3977211bd0f189be57c52.zip riscv-openocd-9eea9cce3f0931d9ecf3977211bd0f189be57c52.tar.gz riscv-openocd-9eea9cce3f0931d9ecf3977211bd0f189be57c52.tar.bz2 |
helper/command: remove search for "ocd_" prefix
We do not register commands with special "ocd_" prefix anymore.
Change-Id: I588816eb22c2435a97be5fbfa87ee5584274b02f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5087
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/command.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index 98c62cf..0f35f85 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -812,8 +812,6 @@ static COMMAND_HELPER(command_help_find, struct command *head, if (0 == CMD_ARGC) return ERROR_COMMAND_SYNTAX_ERROR; *out = command_find(head, CMD_ARGV[0]); - if (NULL == *out && strncmp(CMD_ARGV[0], "ocd_", 4) == 0) - *out = command_find(head, CMD_ARGV[0] + 4); if (NULL == *out) return ERROR_COMMAND_SYNTAX_ERROR; if (--CMD_ARGC == 0) @@ -967,18 +965,16 @@ COMMAND_HANDLER(handle_help_command) } static int command_unknown_find(unsigned argc, Jim_Obj *const *argv, - struct command *head, struct command **out, bool top_level) + struct command *head, struct command **out) { if (0 == argc) return argc; const char *cmd_name = Jim_GetString(argv[0], NULL); struct command *c = command_find(head, cmd_name); - if (NULL == c && top_level && strncmp(cmd_name, "ocd_", 4) == 0) - c = command_find(head, cmd_name + 4); if (NULL == c) return argc; *out = c; - return command_unknown_find(--argc, ++argv, (*out)->children, out, false); + return command_unknown_find(--argc, ++argv, (*out)->children, out); } static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) @@ -994,7 +990,7 @@ static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) struct command_context *cmd_ctx = current_command_context(interp); struct command *c = cmd_ctx->commands; - int remaining = command_unknown_find(argc, argv, c, &c, true); + int remaining = command_unknown_find(argc, argv, c, &c); /* if nothing could be consumed, then it's really an unknown command */ if (remaining == argc) { const char *cmd = Jim_GetString(argv[0], NULL); @@ -1036,7 +1032,7 @@ static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) if (argc > 1) { struct command *c = cmd_ctx->commands; - int remaining = command_unknown_find(argc - 1, argv + 1, c, &c, true); + int remaining = command_unknown_find(argc - 1, argv + 1, c, &c); /* if nothing could be consumed, then it's an unknown command */ if (remaining == argc - 1) { Jim_SetResultString(interp, "unknown", -1); |