X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fhelper%2Fstartup.tcl;h=a7c0d5844f8523031e0c612d70c9c59ec990364d;hb=8890ce34696d2e6a18eeda4a410724d24ad57360;hp=d1c73ef3f2a188f1e05d91dd7393bda8f4cf94cb;hpb=5dd6457d2c06caed01d4b75ecf1415afc68b48ea;p=openocd.git diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index d1c73ef3f2..a7c0d5844f 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -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 "" 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 "" ######### -# catch any exceptions, capture output and return output -proc capture_catch {a} { - catch { - capture {uplevel $a} - } result - return $result -}