cmdr
Check-in [f4a5130c2e]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Tweaked the auto-help command. Default to full format only when asking for a specific command, otherwise default to a simple list.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f4a5130c2e4f31719e7a9530f0dc8faea6314201
User & Date: andreask 2013-10-15 23:46:11
Context
2013-10-16
17:06
Fixed bug in lappend for common blocks. Was not appending, but overwriting with last :( check-in: e8833211e0 user: andreask tags: trunk
2013-10-15
23:46
Tweaked the auto-help command. Default to full format only when asking for a specific command, otherwise default to a simple list. check-in: f4a5130c2e user: andreask tags: trunk
2013-09-23
20:11
Added missing normalization of boolean values by its validation type. check-in: fa1b9689aa user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to help.tcl.

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
132
133
134
135
136
137
138









139
140
141
142
143
144
145
	    Without arguments help for all commands is given.
	    The default format is --full.
	}
	@[email protected]
	state format {
	    Format of the help to generate.
	    This field is fed by the options @[email protected]
	} { default full }
	input cmdname {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} { optional ; list }
    } {::cmdr::help::auto-help @[email protected]}}]
    return
................................................................................

proc ::cmdr::help::auto-help {actor config} {
    debug.cmdr/help {}

    set width  [$config @width]
    set words  [$config @cmdname]
    set format [$config @format]










    puts [format $format $width [DictSort [query $actor $words]]]
    return
}

proc ::cmdr::help::DictSort {dict} {
    set r {}






|







 







>
>
>
>
>
>
>
>
>







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
	    Without arguments help for all commands is given.
	    The default format is --full.
	}
	@[email protected]
	state format {
	    Format of the help to generate.
	    This field is fed by the options @[email protected]
	} { default {} }
	input cmdname {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} { optional ; list }
    } {::cmdr::help::auto-help @[email protected]}}]
    return
................................................................................

proc ::cmdr::help::auto-help {actor config} {
    debug.cmdr/help {}

    set width  [$config @width]
    set words  [$config @cmdname]
    set format [$config @format]

    if {$format eq {}} {
	# Default depends on the presence of additional arguments, i.e. if a specific command is asked for, or not.
	if {[llength $words]} {
	    set format full
	} else {
	    set format list
	}
    }

    puts [format $format $width [DictSort [query $actor $words]]]
    return
}

proc ::cmdr::help::DictSort {dict} {
    set r {}