diff options
author | Paul Fertser <fercerpav@gmail.com> | 2019-04-03 18:50:41 +0200 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2019-05-14 19:38:51 +0100 |
commit | 6da0512092d03bb9ea08df0cafd5d3fbaef432d2 (patch) | |
tree | 1a7df0b852937f4cb0464e192321bdcecd77f2c4 /src/helper/command.c | |
parent | 0840414f0e57cb9b64867ac3e57d266502ea2ee4 (diff) |
helper/command: remove command "command type"
Once the wrapper "ocd_bouncer" is removed (which was the only user
of this command), there is no reason to keep the command any
longer.
Remove it.
This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.
Change-Id: I979ce1c147babedb44dd77418751133f589f827c
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5084
Tested-by: jenkins
Diffstat (limited to 'src/helper/command.c')
-rw-r--r-- | src/helper/command.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index 4883984f..98c62cf8 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1065,32 +1065,6 @@ static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } -static int jim_command_type(Jim_Interp *interp, int argc, Jim_Obj *const *argv) -{ - if (1 == argc) - return JIM_ERR; - - struct command_context *cmd_ctx = current_command_context(interp); - struct command *c = cmd_ctx->commands; - int remaining = command_unknown_find(argc - 1, argv + 1, c, &c, true); - /* if nothing could be consumed, then it's an unknown command */ - if (remaining == argc - 1) { - Jim_SetResultString(interp, "unknown", -1); - return JIM_OK; - } - - if (c->jim_handler) - Jim_SetResultString(interp, "native", -1); - else if (c->handler) - Jim_SetResultString(interp, "simple", -1); - else if (remaining == 0) - Jim_SetResultString(interp, "group", -1); - else - Jim_SetResultString(interp, "unknown", -1); - - return JIM_OK; -} - int help_add_command(struct command_context *cmd_ctx, struct command *parent, const char *cmd_name, const char *help_text, const char *usage) { @@ -1211,15 +1185,6 @@ static const struct command_registration command_subcommand_handlers[] = { "Returns 'unknown' if an unknown command is given. " "Command can be multiple tokens.", }, - { - .name = "type", - .mode = COMMAND_ANY, - .jim_handler = jim_command_type, - .usage = "command_name [...]", - .help = "Returns the type of built-in command:" - "'native', 'simple', 'group', or 'unknown'. " - "Command can be multiple tokens.", - }, COMMAND_REGISTRATION_DONE }; |