cfi: remove typos and code cleanup
[fw/openocd] / src / helper / startup.tcl
index d1c73ef3f2a188f1e05d91dd7393bda8f4cf94cb..a7c0d5844f8523031e0c612d70c9c59ec990364d 100644 (file)
@@ -22,7 +22,8 @@ proc ocd_bouncer {name args} {
                if {[catch {eval $cmd $args}] == 0} {
                        return ""
                } else {
-                       set errmsg "Command handler execution failed"
+                       # 'classic' commands output error message as part of progress output
+                       set errmsg ""
                }
        } else {if {$type == "group"} {
                catch {eval ocd_usage $name $args}
@@ -52,19 +53,12 @@ proc find {filename} {
 add_usage_text find "<file>"
 add_help_text find "print full path to file according to OpenOCD search rules"
 
-# Run script
+# Find and run a script
 proc script {filename} {
-       source [find $filename]
+       uplevel #0 [list source [find $filename]]
 }
 add_help_text script "filename of OpenOCD script (tcl) to run"
 add_usage_text script "<file>"
 
 #########
 
-# catch any exceptions, capture output and return output
-proc capture_catch {a} {
-       catch {
-               capture {uplevel $a}
-       } result
-       return $result
-}