Skip to content
Snippets Groups Projects
Commit 7eaed436 authored by oharboe's avatar oharboe
Browse files

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
parent a63361f9
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment