global Draw_Helps Draw_Groups Draw_Files
+ set out {}
if {$command == ""} {
# help general
foreach h [lsort [array names Draw_Groups]] {
- puts ""
- puts ""
- puts $h
+ lappend out "" "" "$h"
set i 0
foreach f [lsort $Draw_Groups($h)] {
if {$i == 0} {
- puts " "
+ lappend out ""
}
incr i
#
#
foreach command_that_has_file [array names Draw_Files] {
if {($command_that_has_file == $f)} {
-#
-# compute the length of the string to have the right spacing
-# with tabs
-#
- set ll [string length $f]
- if {($ll >= 1) && ($ll < 8)} {
- puts "$f\t\t: $Draw_Files($f) "
- }
- if {($ll >= 8)} {
- puts "$f\t: $Draw_Files($f) "
- }
-
+ lappend out [format {%-20s %s} $f $Draw_Files($f)]
}
}
}
append command "*"
foreach f [lsort [array names Draw_Files]] {
if {[string match $command $f]} {
- puts -nonewline $f
- for {set j [string length $f]} {$j < 15} {incr j} {
- puts -nonewline " "
- }
-
- puts " $Draw_Files($f)"
+ lappend out [format {%-20s %s} $f $Draw_Files($f)]
}
}
}
- flush stdout
+ return [join $out "\n"]
}
help getsourcefile {getsourcefile, or getsourcefile command } {DRAW General Commands}