This is an automated email from Gerrit.

Antonio Borneo (borneo.anto...@gmail.com) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5084

-- gerrit

commit be6158d218501878ec235bca455e8c662bf8ed16
Author: Paul Fertser <fercer...@gmail.com>
Date:   Wed Apr 3 18:50:41 2019 +0200

    helper/command: remove command "command type"
    
    We need a reason for this change!
    
    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 <fercer...@gmail.com>
    Signed-off-by: Tomas Vanek <van...@fbl.cz>
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/helper/command.c b/src/helper/command.c
index 41151cb..7ccf36e 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -1082,32 +1082,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)
 {
@@ -1227,15 +1201,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
 };
 

-- 


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to