On Fri, Jul 29, 2011 at 8:16 AM, Steve Bennett <[email protected]> wrote:
> Makes sense to me to change it to:
> proc script {filename} {
>        uplevel #0 source [find $filename]
> }
>
The attached patch removes "script" command completely.


Jie
From f00a57d009fb713091b096521e82600a2e2401c2 Mon Sep 17 00:00:00 2001
From: Jie Zhang <[email protected]>
Date: Fri, 29 Jul 2011 10:45:10 -0400
Subject: [PATCH] remove script command

---
 src/helper/configuration.c |    2 +-
 src/helper/options.c       |    2 +-
 src/helper/startup.tcl     |    7 -------
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/helper/configuration.c b/src/helper/configuration.c
index eedd8a1..752b338 100644
--- a/src/helper/configuration.c
+++ b/src/helper/configuration.c
@@ -116,7 +116,7 @@ int parse_config_file(struct command_context *cmd_ctx)
 	char **cfg;
 
 	if (!config_file_names) {
-		command_run_line(cmd_ctx, "script openocd.cfg");
+		command_run_line(cmd_ctx, "source [find openocd.cfg]");
 		return ERROR_OK;
 	}
 
diff --git a/src/helper/options.c b/src/helper/options.c
index f8db2cd..0d77fde 100644
--- a/src/helper/options.c
+++ b/src/helper/options.c
@@ -150,7 +150,7 @@ int parse_cmdline_args(struct command_context *cmd_ctx, int argc, char *argv[])
 				break;
 			case 'f':	/* --file | -f */
 			{
-				snprintf(command_buffer, 128, "script {%s}", optarg);
+				snprintf(command_buffer, 128, "source [find %s]", optarg);
 				add_config_command(command_buffer);
 				break;
 			}
diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl
index 2e2982c..dc43801 100644
--- a/src/helper/startup.tcl
+++ b/src/helper/startup.tcl
@@ -53,12 +53,5 @@ proc find {filename} {
 add_usage_text find "<file>"
 add_help_text find "print full path to file according to OpenOCD search rules"
 
-# Run script
-proc script {filename} {
-	source [find $filename]
-}
-add_help_text script "filename of OpenOCD script (tcl) to run"
-add_usage_text script "<file>"
-
 #########
 
-- 
1.7.5.4

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to