diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-18 13:07:37 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-18 13:07:37 +0000 |
commit | 7eaed436c63689db74adebf1201fb45e109cb290 (patch) | |
tree | a141e2f600c16e068eb71b04ee0706274b747dd3 | |
parent | a63361f982ed60a378490397a24271ae725b0234 (diff) | |
download | openocd+libswd-7eaed436c63689db74adebf1201fb45e109cb290.tar.gz openocd+libswd-7eaed436c63689db74adebf1201fb45e109cb290.tar.bz2 openocd+libswd-7eaed436c63689db74adebf1201fb45e109cb290.tar.xz openocd+libswd-7eaed436c63689db74adebf1201fb45e109cb290.zip |
less weird error messages for unknown commands. Check if command exists before trying it.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1810 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/helper/startup.tcl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index eb965e00..a6b50aa3 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -88,9 +88,10 @@ proc unknown {args} { # do the name mangling from "flash banks" to "flash_banks" if {[llength $args]>=2} { set cmd_name "[lindex $args 0]_[lindex $args 1]" - # Fix?? add a check here if this is a command? - # we'll strip away args until we fail anyway... - return [eval "$cmd_name [lrange $args 2 end]"] + if {[catch {info body $cmd_name}]==0} { + # the command exists, try it... + return [eval "$cmd_name [lrange $args 2 end]"] + } } # This really is an unknown command. return -code error "Unknown command: $args" |