diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 11:32:03 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:41 +1000 |
commit | c5bf0eb2d41b437999394486dc4d7eace5dc0c27 (patch) | |
tree | 25a42d2f8a8e2419be8503c2fece94ff917e7a9d /doc/make-index | |
parent | b0950211281e786a633692eee2a4096e8457ed82 (diff) | |
download | jimtcl-c5bf0eb2d41b437999394486dc4d7eace5dc0c27.zip jimtcl-c5bf0eb2d41b437999394486dc4d7eace5dc0c27.tar.gz jimtcl-c5bf0eb2d41b437999394486dc4d7eace5dc0c27.tar.bz2 |
Bug fixes, documentation updates
jimsh - retry on EINTR from fgets()
Fix 0 -> NULL for 64 bit systems
Fix overlapping memcpy
Fix jim array dereferencing bug
*: Counting of parentheses was incorrect with nested array references
*: The result for array dereference wasn't being used properly
Add os.uptime command
Documentation: autogenerated command index
Fix gets when last line has no newline
Diffstat (limited to 'doc/make-index')
-rwxr-xr-x | doc/make-index | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/doc/make-index b/doc/make-index new file mode 100755 index 0000000..bda0a0f --- /dev/null +++ b/doc/make-index @@ -0,0 +1,59 @@ +#!/bin/sh +# \ +PATH=$UWEBDIR/bin:$PATH; exec jimsh $0 "$@" + +# vim:se syn=tcl: + +while {[stdin gets buf] >= 0} { + if {$buf eq "@INSERTINDEX@"} { + break + } + puts $buf +} + +# Collect lines and commands +set lines {} +set commands {} +set c 0 + +while {[stdin gets buf] >= 0} { + if {[string match "~~*" $buf]} { + if {[string match "*:*" $prev]} { + incr c + set target cmd_$c + set lines [linsert $lines end-1 "\[\[$target\]\]"] + } else { + set target _$prev + } + foreach cmd [split $prev ":,"] { + set cmd [string trim $cmd] + if {$cmd ne ""} { + lappend commands [list $cmd $target] + } + } + } + lappend lines $buf + set prev $buf +} + +# Output the index +puts {[frame="none",grid="none"]} +puts {|=========================} +set i 0 +foreach command [lsort $commands] { + foreach {cmd target} $command break + + puts -nonewline "|<<$target,$cmd>> " + incr i + if {$i % 8 == 0} { + puts "" + } +} +while {$i % 8 != 0} { + incr i + puts -nonewline "| " +} +puts "" +puts {|=========================} + +puts [join $lines \n] |