]> git.sur5r.net Git - openocd/blobdiff - src/helper/interpreter.c
- command_run_line will only search once for the command, and execute if found
[openocd] / src / helper / interpreter.c
index c5c38b83bccb65fe2c2e95e3c2a918b8c7206f1f..186d992e3cb48f1d38d46e9da3d4a40b00aac5be 100644 (file)
@@ -184,7 +184,7 @@ int handle_field_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
 {
 
        if (argc < 2)
-               command_print(cmd_ctx, "usage: field <var> <field> [value|'flip']");
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
        if (argc >= 2)
        {
@@ -217,26 +217,20 @@ int handle_field_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
 int handle_script_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
        FILE *script_file;
-       int echo;
 
        if (argc != 1)
-               command_print(cmd_ctx, "usage: script <file>");
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
-       script_file = open_file_from_path(cmd_ctx, args[0], "r");
+       script_file = open_file_from_path (args[0], "r");
 
        if (!script_file)
        {
                command_print(cmd_ctx, "couldn't open script file %s", args[0]);
                return ERROR_OK;
        }
-
-       echo = cmd_ctx->echo;
-       cmd_ctx->echo = 1;
        
        command_run_file(cmd_ctx, script_file, cmd_ctx->mode);
        
-       cmd_ctx->echo = echo;
-       
        fclose(script_file);
 
        return ERROR_OK;