From 5458fef43ca7072312440301a9469c686ca641e2 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Thu, 19 Nov 2009 06:48:37 -0800 Subject: improve 'help' command Rewrites 'help' command in C, using new 'cmd_help' for display. Adds the built-in 'help' COMMAND_HANDLER to provide better output than the TCL-based script command (e.g. heirarchical listing of commands). The help string is stored in the command structure, though it conitnues to be pushed into the Jim environment. The current idiomatic usage suggests the addition of a usage field as well, to provide two levels of detail for users to consume (i.e. terse usage list, or verbose help). --- src/helper/startup.tcl | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/helper/startup.tcl') diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index 30dc184f..ddfef1dc 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -58,24 +58,6 @@ proc cmd_help {cmdname h indent} { } } -#Print help text for a command. Word wrap -#help text that is too wide inside column. -proc help {args} { - global ocd_helptext - set cmd $args - foreach a [lsort $ocd_helptext] { - if {[string length $cmd] == 0 || \ - [string first $cmd $a] != -1 || \ - [string first $cmd [lindex $a 1]] != -1} \ - { - cmd_help [lindex $a 0] [lindex $a 1] 0 - } - } -} - -add_help_text help "Tcl implementation of help command" - - # If a fn is unknown to Tcl, we try to execute it as an OpenOCD command # # We also support two level commands. "flash banks" is translated to -- cgit v1.2.3