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
This commit is contained in:
Paul Fertser 2019-04-03 18:50:41 +02:00 committed by Tomas Vanek
parent 0840414f0e
commit 6da0512092
1 changed files with 0 additions and 35 deletions

View File

@ -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
};