cmdr
Check-in [0ed8f3610b]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

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

Overview
Comment:Moved dictsort utility into util for wider use. Sort parts of the help structures for easier testing. Fixed bugs in the help generation (1) Skip imported helper commands which are not formats. (2) Rendering of list inputs was off. -- Bumped version to 0.12, help (json, sql) to 0.2, fixed requirements -- Updated embedded documentation.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0ed8f3610be51d12d02a4b57c92329b54ee30c74
User & Date: aku 2013-11-16 23:15:20
Context
2013-11-17
01:01
Added a behaviour flag "no-promote" to parameters, to allow rejection of promotion of unknown flag strings to input values on principle. Bumped version to 0.13, updated embedded documentation. check-in: b9126a7a27 user: aku tags: trunk
2013-11-16
23:15
Moved dictsort utility into util for wider use. Sort parts of the help structures for easier testing. Fixed bugs in the help generation (1) Skip imported helper commands which are not formats. (2) Rendering of list inputs was off. -- Bumped version to 0.12, help (json, sql) to 0.2, fixed requirements -- Updated embedded documentation. check-in: 0ed8f3610b user: aku tags: trunk
2013-11-15
23:10
Extended the shells to note their activity in a root common block named *in-shell*. Bumped version to 0.11. check-in: 5a480bf9d8 user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to actor.tcl.

309
310
311
312
313
314
315
316

    ##
    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::actor 0.11







|
309
310
311
312
313
314
315
316

    ##
    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::actor 0.12

Changes to cmdr.tcl.

71
72
73
74
75
76
77
78
proc ::cmdr::interactive? {} {
    variable interactive
    return  $interactive
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr 0.11







|
71
72
73
74
75
76
77
78
proc ::cmdr::interactive? {} {
    variable interactive
    return  $interactive
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr 0.12

Changes to config.tcl.

176
177
178
179
180
181
182




183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
....
1352
1353
1354
1355
1356
1357
1358
1359
	    # in interactive mode we skip all the aliases.
	    if {($mode eq "interact") &&
		![$para primary $o]} continue
	    dict set options $o [$para description $o]
	    dict set optpara $o [$para name]
	}





	set arguments $myargs
	set sections  $mysections

	# Full dump of the parameter definitions. Unusual formats
	# (SQL, json) may wish to have acess to all of a parameter,
	# not just bits and pieces.

	set states     {}
	set parameters {}

	foreach p $mynames {
	    set para [dict get $mymap $p]
	    dict set parameters $p [$para help]

	    if {![$para is state]} continue
	    lappend states $p
	}

................................................................................
    }

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::config 0.11







>
>
>
>










|







 







|
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
....
1356
1357
1358
1359
1360
1361
1362
1363
	    # in interactive mode we skip all the aliases.
	    if {($mode eq "interact") &&
		![$para primary $o]} continue
	    dict set options $o [$para description $o]
	    dict set optpara $o [$para name]
	}

	# Order not required of the structure, improves testability
	set options [cmdr util dictsort $options]
	set optpara [cmdr util dictsort $optpara]

	set arguments $myargs
	set sections  $mysections

	# Full dump of the parameter definitions. Unusual formats
	# (SQL, json) may wish to have acess to all of a parameter,
	# not just bits and pieces.

	set states     {}
	set parameters {}

	foreach p [lsort -dict $mynames] {
	    set para [dict get $mymap $p]
	    dict set parameters $p [$para help]

	    if {![$para is state]} continue
	    lappend states $p
	}

................................................................................
    }

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::config 0.12

Changes to doc/cmdr_util.man.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
22
23
24
25
26
27
28











29
30
31
32
[manpage_begin [vset PROJECT]::util [vset MAN_SECTION] [vset VERSION]]
[include parts/module.inc]
[require cmdr::util]
[titledesc [vset TITLE_UTIL]]
[description]
[include parts/welcome.inc]

This internal package provides a single utility command.

[section API]
[list_begin definitions]
[comment {- - -- --- ----- -------- -------------}]
[call [cmd ::cmdr::util] [method padr] [arg list]]

When invoked this command pads all elements of the specified
................................................................................
[para] The modified list is returned as the result of the command.

[list_begin arguments]
[arg_def list list]
A list of strings to normalize in length by appending space characters
as needed.
[list_end]












[list_end]
[include parts/feedback.inc]
[manpage_end]







|







 







>
>
>
>
>
>
>
>
>
>
>




3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[manpage_begin [vset PROJECT]::util [vset MAN_SECTION] [vset VERSION]]
[include parts/module.inc]
[require cmdr::util]
[titledesc [vset TITLE_UTIL]]
[description]
[include parts/welcome.inc]

This internal package provides a few utility commands.

[section API]
[list_begin definitions]
[comment {- - -- --- ----- -------- -------------}]
[call [cmd ::cmdr::util] [method padr] [arg list]]

When invoked this command pads all elements of the specified
................................................................................
[para] The modified list is returned as the result of the command.

[list_begin arguments]
[arg_def list list]
A list of strings to normalize in length by appending space characters
as needed.
[list_end]

[comment {- - -- --- ----- -------- -------------}]
[call [cmd ::cmdr::util] [method dictsort] [arg dict]]

When invoked this command sorts the provided dictionary by its keys.

[para] The modified dictionary is returned as the result of the command.

[list_begin arguments]
[arg_def dictionary dict] The dictionary to sort.
[list_end]

[list_end]
[include parts/feedback.inc]
[manpage_end]

Changes to embedded/man/files/cmdr_util.n.

244
245
246
247
248
249
250


251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
...
267
268
269
270
271
272
273










274
275
276
277
278
279
280
.SH NAME
cmdr::util \- Cmdr - General Utilities - Internal
.SH SYNOPSIS
package require \fBcmdr::util \fR
.sp
\fB::cmdr::util\fR \fBpadr\fR \fIlist\fR
.sp


.BE
.SH DESCRIPTION
.PP
Welcome to the Cmdr project, written by Andreas Kupries\&.
.PP
For availability please read \fICmdr - How To Get The Sources\fR\&.
.PP
This internal package provides a single utility command\&.
.SH API
.TP
\fB::cmdr::util\fR \fBpadr\fR \fIlist\fR
When invoked this command pads all elements of the specified
\fIlist\fR at their end with space (ASCII 32 decimal) characters to
make them all the same length, the length of the longest element in
the list\&.
................................................................................
The modified list is returned as the result of the command\&.
.RS
.TP
list \fIlist\fR
A list of strings to normalize in length by appending space characters
as needed\&.
.RE










.PP
.SH "BUGS, IDEAS, FEEDBACK"
Both the package(s) and this documentation will undoubtedly contain
bugs and other problems\&.
Please report such at
\fICmdr Tickets\fR [https:/core\&.tcl\&.tk/akupries/cmdr]\&.
.PP







>
>







|







 







>
>
>
>
>
>
>
>
>
>







244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
.SH NAME
cmdr::util \- Cmdr - General Utilities - Internal
.SH SYNOPSIS
package require \fBcmdr::util \fR
.sp
\fB::cmdr::util\fR \fBpadr\fR \fIlist\fR
.sp
\fB::cmdr::util\fR \fBdictsort\fR \fIdict\fR
.sp
.BE
.SH DESCRIPTION
.PP
Welcome to the Cmdr project, written by Andreas Kupries\&.
.PP
For availability please read \fICmdr - How To Get The Sources\fR\&.
.PP
This internal package provides a few utility commands\&.
.SH API
.TP
\fB::cmdr::util\fR \fBpadr\fR \fIlist\fR
When invoked this command pads all elements of the specified
\fIlist\fR at their end with space (ASCII 32 decimal) characters to
make them all the same length, the length of the longest element in
the list\&.
................................................................................
The modified list is returned as the result of the command\&.
.RS
.TP
list \fIlist\fR
A list of strings to normalize in length by appending space characters
as needed\&.
.RE
.TP
\fB::cmdr::util\fR \fBdictsort\fR \fIdict\fR
When invoked this command sorts the provided dictionary by its keys\&.
.sp
The modified dictionary is returned as the result of the command\&.
.RS
.TP
dictionary \fIdict\fR
The dictionary to sort\&.
.RE
.PP
.SH "BUGS, IDEAS, FEEDBACK"
Both the package(s) and this documentation will undoubtedly contain
bugs and other problems\&.
Please report such at
\fICmdr Tickets\fR [https:/core\&.tcl\&.tk/akupries/cmdr]\&.
.PP

Changes to embedded/www/doc/files/cmdr_util.html.

123
124
125
126
127
128
129

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149







150
151
152
153
154
155
156
<div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="synopsis">
<ul class="requirements">
<li>package require <b class="pkgname">cmdr::util</b></li>
</ul>
<ul class="syntax">
<li><a href="#1"><b class="cmd">::cmdr::util</b> <b class="method">padr</b> <i class="arg">list</i></a></li>

</ul>
</div>
</div>
<div id="section1" class="section"><h2><a name="section1">Description</a></h2>
<p>Welcome to the Cmdr project, written by Andreas Kupries.</p>
<p>For availability please read <i class="term"><a href="cmdr_howto_get_sources.html">Cmdr - How To Get The Sources</a></i>.</p>
<p>This internal package provides a single utility command.</p>
</div>
<div id="section2" class="section"><h2><a name="section2">API</a></h2>
<dl class="definitions">
<dt><a name="1"><b class="cmd">::cmdr::util</b> <b class="method">padr</b> <i class="arg">list</i></a></dt>
<dd><p>When invoked this command pads all elements of the specified
<i class="arg">list</i> at their end with space (ASCII 32 decimal) characters to
make them all the same length, the length of the longest element in
the list.</p>
<p>The modified list is returned as the result of the command.</p>
<dl class="arguments">
<dt>list <i class="arg">list</i></dt>
<dd><p>A list of strings to normalize in length by appending space characters
as needed.</p></dd>







</dl></dd>
</dl>
</div>
<div id="section3" class="section"><h2><a name="section3">Bugs, Ideas, Feedback</a></h2>
<p>Both the package(s) and this documentation will undoubtedly contain
bugs and other problems.
Please report such at







>






|













>
>
>
>
>
>
>







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<div id="synopsis" class="section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="synopsis">
<ul class="requirements">
<li>package require <b class="pkgname">cmdr::util</b></li>
</ul>
<ul class="syntax">
<li><a href="#1"><b class="cmd">::cmdr::util</b> <b class="method">padr</b> <i class="arg">list</i></a></li>
<li><a href="#2"><b class="cmd">::cmdr::util</b> <b class="method">dictsort</b> <i class="arg">dict</i></a></li>
</ul>
</div>
</div>
<div id="section1" class="section"><h2><a name="section1">Description</a></h2>
<p>Welcome to the Cmdr project, written by Andreas Kupries.</p>
<p>For availability please read <i class="term"><a href="cmdr_howto_get_sources.html">Cmdr - How To Get The Sources</a></i>.</p>
<p>This internal package provides a few utility commands.</p>
</div>
<div id="section2" class="section"><h2><a name="section2">API</a></h2>
<dl class="definitions">
<dt><a name="1"><b class="cmd">::cmdr::util</b> <b class="method">padr</b> <i class="arg">list</i></a></dt>
<dd><p>When invoked this command pads all elements of the specified
<i class="arg">list</i> at their end with space (ASCII 32 decimal) characters to
make them all the same length, the length of the longest element in
the list.</p>
<p>The modified list is returned as the result of the command.</p>
<dl class="arguments">
<dt>list <i class="arg">list</i></dt>
<dd><p>A list of strings to normalize in length by appending space characters
as needed.</p></dd>
</dl></dd>
<dt><a name="2"><b class="cmd">::cmdr::util</b> <b class="method">dictsort</b> <i class="arg">dict</i></a></dt>
<dd><p>When invoked this command sorts the provided dictionary by its keys.</p>
<p>The modified dictionary is returned as the result of the command.</p>
<dl class="arguments">
<dt>dictionary <i class="arg">dict</i></dt>
<dd><p>The dictionary to sort.</p></dd>
</dl></dd>
</dl>
</div>
<div id="section3" class="section"><h2><a name="section3">Bugs, Ideas, Feedback</a></h2>
<p>Both the package(s) and this documentation will undoubtedly contain
bugs and other problems.
Please report such at

Changes to help.tcl.

88
89
90
91
92
93
94
95
96




97
98
99
100
101
102
103
...
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
...
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
...
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
...
510
511
512
513
514
515
516
517
# # ## ### ##### ######## ############# #####################

proc ::cmdr::help::auto {actor} {
    debug.cmdr/help {}
    # Generate a standard help command for any actor, and add it dynamically.

    # Auto create options based on the help formats found installed
    foreach c [info commands {::cmdr::help::format::[a-z]*}] {
	set format [namespace tail $c]




	lappend formats --$format
	lappend options [string map [list @c@ $format] {
	    option @c@ {
		Activate @c@ form of the help.
	    } {
		presence
		when-set [lambda {p x} { $p config @format set @c@ }]
................................................................................
	if {[llength $words]} {
	    set format full
	} else {
	    set format by-category
	}
    }

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

proc ::cmdr::help::DictSort {dict} {
    set r {}
    foreach k [lsort -dict [dict keys $dict]] {
	lappend r $k [dict get $dict $k]
    }
    return $r
}

# # ## ### ##### ######## ############# #####################

namespace eval ::cmdr::help::format {
    namespace export full list short by-category
    namespace ensemble create

    namespace import ::cmdr::help::query
................................................................................
			   {    }]
    }

    # plus per-option descriptions (sort by flag name)
    if {[dict size $options]} {
	set onames {}
	set odefs  {}
	foreach {oname ohelp} [::cmdr::help::DictSort $options] {
	    lappend onames $oname
	    lappend odefs  $ohelp
	}
	DefList $width $onames $odefs
    }

    # plus per-argument descriptions (keep in cmdline order)
................................................................................
    set result {}
    foreach a $arguments {
	set v [dict get $parameters $a]
	dict with v {} ; # -> code, desc, label
	switch -exact -- $code {
	    +  { set text "<$label>" }
	    ?  { set text "\[<${label}>\]" }
	    +* { set text "<{label}>..." }
	    ?* { set text "\[<${label}>...\]" }
	}
	lappend result $text
    }
    return [join $result]
}

................................................................................

    return $categories
}


# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help 0.11







|

>
>
>
>







 







|



<
<
<
<
<
<
<
<







 







|







 







|







 







|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
...
156
157
158
159
160
161
162
163
164
165
166








167
168
169
170
171
172
173
...
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
...
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
...
506
507
508
509
510
511
512
513
# # ## ### ##### ######## ############# #####################

proc ::cmdr::help::auto {actor} {
    debug.cmdr/help {}
    # Generate a standard help command for any actor, and add it dynamically.

    # Auto create options based on the help formats found installed
    foreach c [lsort -dict [info commands {::cmdr::help::format::[a-z]*}]] {
	set format [namespace tail $c]

	# Skip the imported helper commands which are NOT formats
	if {[string match query* $format]} continue

	lappend formats --$format
	lappend options [string map [list @c@ $format] {
	    option @c@ {
		Activate @c@ form of the help.
	    } {
		presence
		when-set [lambda {p x} { $p config @format set @c@ }]
................................................................................
	if {[llength $words]} {
	    set format full
	} else {
	    set format by-category
	}
    }

    puts [format $format [$actor root] $width [cmdr util dictsort [query $actor $words]]]
    return
}









# # ## ### ##### ######## ############# #####################

namespace eval ::cmdr::help::format {
    namespace export full list short by-category
    namespace ensemble create

    namespace import ::cmdr::help::query
................................................................................
			   {    }]
    }

    # plus per-option descriptions (sort by flag name)
    if {[dict size $options]} {
	set onames {}
	set odefs  {}
	foreach {oname ohelp} [::cmdr util dictsort $options] {
	    lappend onames $oname
	    lappend odefs  $ohelp
	}
	DefList $width $onames $odefs
    }

    # plus per-argument descriptions (keep in cmdline order)
................................................................................
    set result {}
    foreach a $arguments {
	set v [dict get $parameters $a]
	dict with v {} ; # -> code, desc, label
	switch -exact -- $code {
	    +  { set text "<$label>" }
	    ?  { set text "\[<${label}>\]" }
	    +* { set text "<${label}>..." }
	    ?* { set text "\[<${label}>...\]" }
	}
	lappend result $text
    }
    return [join $result]
}

................................................................................

    return $categories
}


# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help 0.12

Changes to help_json.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Help - JSON format. Not available by default.
## Require this package before creation a commander, so that the
## mdr::help heuristics see and automatically integrate the format.

# @@ Meta Begin
# Package cmdr::help::json 0.1
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Formatting help as JSON object.
# Meta description Formatting help as JSON object.
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require debug
# Meta require debug::caller
# Meta require cmdr::help

# Meta require json::write
# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require debug
package require debug::caller
package require cmdr::help

package require json::write

# # ## ### ##### ######## ############# #####################

debug define cmdr/help/json
debug level  cmdr/help/json
debug prefix cmdr/help/json {[debug caller] | }
................................................................................
    lappend dict sections    [JSON::alist      $sections]
    
    return [json::write object {*}$dict]
}

proc ::cmdr::help::format::JSON::parameters {parameters} {
    set dict {}
    foreach {name def} [::cmdr::help::DictSort $parameters] {
	set tmp {}
	foreach {xname xdef} [::cmdr::help::DictSort $def] {
	    switch -glob -- $xname {
		cmdline -
		defered -
		documented -
		interactive -
		isbool -
		list -
................................................................................
	lappend tmp [json::write string $w]
    }
    return [json::write array {*}$tmp]
}

proc ::cmdr::help::format::JSON::adict {thedict} {
    set tmp {}
    foreach {k v} [::cmdr::help::DictSort $thedict] {
	lappend tmp $k [json::write string $v]
    }
    return [json::write object {*}$tmp]
}

proc ::cmdr::help::format::JSON::astring {string} {
    regsub -all -- {[ \n\t]+} $string { } string
    return [json::write string [string trim $string]]
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help::json 0.1







|









|
>









|
>







 







|

|







 







|












|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Help - JSON format. Not available by default.
## Require this package before creation a commander, so that the
## mdr::help heuristics see and automatically integrate the format.

# @@ Meta Begin
# Package cmdr::help::json 0.2
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Formatting help as JSON object.
# Meta description Formatting help as JSON object.
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require debug
# Meta require debug::caller
# Meta require {cmdr::help 0.12}
# Meta require {cmdr::util 0.12}
# Meta require json::write
# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require debug
package require debug::caller
package require cmdr::help 0.12
package require cmdr::util 0.12
package require json::write

# # ## ### ##### ######## ############# #####################

debug define cmdr/help/json
debug level  cmdr/help/json
debug prefix cmdr/help/json {[debug caller] | }
................................................................................
    lappend dict sections    [JSON::alist      $sections]
    
    return [json::write object {*}$dict]
}

proc ::cmdr::help::format::JSON::parameters {parameters} {
    set dict {}
    foreach {name def} [::cmdr util dictsort $parameters] {
	set tmp {}
	foreach {xname xdef} [::cmdr util dictsort $def] {
	    switch -glob -- $xname {
		cmdline -
		defered -
		documented -
		interactive -
		isbool -
		list -
................................................................................
	lappend tmp [json::write string $w]
    }
    return [json::write array {*}$tmp]
}

proc ::cmdr::help::format::JSON::adict {thedict} {
    set tmp {}
    foreach {k v} [::cmdr util dictsort $thedict] {
	lappend tmp $k [json::write string $v]
    }
    return [json::write object {*}$tmp]
}

proc ::cmdr::help::format::JSON::astring {string} {
    regsub -all -- {[ \n\t]+} $string { } string
    return [json::write string [string trim $string]]
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help::json 0.2

Changes to help_sql.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
...
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
...
287
288
289
290
291
292
293
294
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Help - SQL format. Not available by default.
## Require this package before creation a commander, so that the
## mdr::help heuristics see and automatically integrate the format.

# @@ Meta Begin
# Package cmdr::help::sql 0.1
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Formatting help as series of SQL commands.
# Meta description Formatting help as series of SQL commands.
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require debug
# Meta require debug::caller
# Meta require cmdr::help

# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require debug
package require debug::caller
package require cmdr::help


# # ## ### ##### ######## ############# #####################

debug define cmdr/help/sql
debug level  cmdr/help/sql
debug prefix cmdr/help/sql {[debug caller] | }

................................................................................

    return
}

proc ::cmdr::help::format::SQL::para {def} {
    set result {}

    foreach {xname xdef} [::cmdr::help::DictSort $def] {
	switch -glob -- $xname {
	    cmdline -
	    defered -
	    documented -
	    interactive -
	    isbool -
	    list -
................................................................................
	       pid  INTEGER REFERENCES parameters
       );
	CREATE INDEX fname on flags ( name );
    }
}
# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help::sql 0.1







|









|
>








|
>







 







|







 







|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
...
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
...
289
290
291
292
293
294
295
296
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Help - SQL format. Not available by default.
## Require this package before creation a commander, so that the
## mdr::help heuristics see and automatically integrate the format.

# @@ Meta Begin
# Package cmdr::help::sql 0.2
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Formatting help as series of SQL commands.
# Meta description Formatting help as series of SQL commands.
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require debug
# Meta require debug::caller
# Meta require {cmdr::help 0.12}
# Meta require {cmdr::util 0.12}
# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require debug
package require debug::caller
package require cmdr::help 0.12
package require cmdr::util 0.12

# # ## ### ##### ######## ############# #####################

debug define cmdr/help/sql
debug level  cmdr/help/sql
debug prefix cmdr/help/sql {[debug caller] | }

................................................................................

    return
}

proc ::cmdr::help::format::SQL::para {def} {
    set result {}

    foreach {xname xdef} [::cmdr util dictsort $def] {
	switch -glob -- $xname {
	    cmdline -
	    defered -
	    documented -
	    interactive -
	    isbool -
	    list -
................................................................................
	       pid  INTEGER REFERENCES parameters
       );
	CREATE INDEX fname on flags ( name );
    }
}
# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help::sql 0.2

Changes to officer.tcl.

614
615
616
617
618
619
620
621
	myreplexit myhandler

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::officer 0.10







|
614
615
616
617
618
619
620
621
	myreplexit myhandler

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::officer 0.12

Changes to parameter.tcl.

1185
1186
1187
1188
1189
1190
1191
1192
	myisundefined

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::parameter 0.11







|
1185
1186
1187
1188
1189
1190
1191
1192
	myisundefined

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::parameter 0.12

Changes to private.tcl.

165
166
167
168
169
170
171
172
    variable myarguments mycmd myinit myconfig myhandler

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::private 0.11







|
165
166
167
168
169
170
171
172
    variable myarguments mycmd myinit myconfig myhandler

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::private 0.12

Changes to tests/help.tests.

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193




















































































194
195
196
197
198
199
200
201
202
203
204
205
206
207
208


209
210
211
212
213
214
215
216
217
218


219
220
221
222
223
224
225
226
227













228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247


248
249
250





251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270


271
272
273





274
275
276
277
278
279
280
281
282
283


284
285
286





287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304


305
306
307





308
309
310
311
312
313
314
315
316
317


318
319
320





321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338


339
340
341





342
343
344
345
346
347
348
349
350
351


352
353
354





355
356
357
358
359
360
361
...
364
365
366
367
368
369
370
371
372
373
374
375


376
377
378





379
380
381
382
383
384
385
386
387
388
389
390
391
392





















393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
	    private cloak {} ::dagger
	}
    }

    regsub -all {::oo::Obj\d+::} [x help] {ZZZ::}
} -cleanup {
    x destroy
} -result {{bar aloha} {desc hawaii options {--lulu loop --no-lulu {Complementary alias of --lulu.}} arguments {yoyo jump run} states {} parameters {lulu {cmdline 1 code ? default no defered 0 description loop documented yes flags {--lulu primary --no-lulu inverted} generator {} interactive no isbool 1 list no ordered 0 presence no prompt {Enter lulu: } required 0 threshold {} type option validator ::cmdr::validate::boolean} yoyo {cmdline 1 code + default {} defered 0 description height documented yes flags {} generator {} interactive no isbool 0 list no ordered 1 presence no prompt {Enter yoyo: } required 1 threshold {} type input validator ::cmdr::validate::identity} jump {cmdline 1 code ? default {} defered 0 description gate documented yes flags {} generator {} interactive no isbool 0 list no ordered 1 presence no prompt {Enter jump: } required no threshold 1 type input validator ::cmdr::validate::identity} run {cmdline 1 code +* default {} defered 0 description lane documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter run: } required 1 threshold {} type input validator ::cmdr::validate::identity}} action ::hula} {bar help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {
		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ZZZ::officer_bar}} {snafu aloha} {desc hawaii options {--lulu loop --no-lulu {Complementary alias of --lulu.}} arguments {yoyo jump run} states {} parameters {lulu {cmdline 1 code ? default no defered 0 description loop documented yes flags {--lulu primary --no-lulu inverted} generator {} interactive no isbool 1 list no ordered 0 presence no prompt {Enter lulu: } required 0 threshold {} type option validator ::cmdr::validate::boolean} yoyo {cmdline 1 code + default {} defered 0 description height documented yes flags {} generator {} interactive no isbool 0 list no ordered 1 presence no prompt {Enter yoyo: } required 1 threshold {} type input validator ::cmdr::validate::identity} jump {cmdline 1 code ? default {} defered 0 description gate documented yes flags {} generator {} interactive no isbool 0 list no ordered 1 presence no prompt {Enter jump: } required no threshold 1 type input validator ::cmdr::validate::identity} run {cmdline 1 code +* default {} defered 0 description lane documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter run: } required 1 threshold {} type input validator ::cmdr::validate::identity}} action ::hula} {snafu help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {
		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ZZZ::officer_bar}} {tool pliers help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {
		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ZZZ::officer_pliers}} {tool hammer nail} {desc workbench options {--driver force --force {Alias of --driver.}} arguments supply states context parameters {driver {cmdline 1 code ?* default 0 defered 0 description force documented yes flags {--force alias --driver primary} generator {} interactive no isbool 0 list yes ordered 0 presence no prompt {Enter driver: } required 0 threshold {} type option validator adouble} context {cmdline 0 code {} default {} defered 1 description orientation documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter context: } required 1 threshold {} type state validator ::cmdr::validate::identity} supply {cmdline 1 code ?* default {} defered 0 description magazine documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter supply: } required no threshold 0 type input validator ::cmdr::validate::identity}} action ::wall} {tool hammer help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {
		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ZZZ::officer_hammer}} {tool help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {
		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ZZZ::officer_tool}} {hammer nail} {desc workbench options {--driver force --force {Alias of --driver.}} arguments supply states context parameters {driver {cmdline 1 code ?* default 0 defered 0 description force documented yes flags {--force alias --driver primary} generator {} interactive no isbool 0 list yes ordered 0 presence no prompt {Enter driver: } required 0 threshold {} type option validator adouble} context {cmdline 0 code {} default {} defered 1 description orientation documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter context: } required 1 threshold {} type state validator ::cmdr::validate::identity} supply {cmdline 1 code ?* default {} defered 0 description magazine documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter supply: } required no threshold 0 type input validator ::cmdr::validate::identity}} action ::wall} {hammer help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {
		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ZZZ::officer_hammer}} help {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {
		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ::x}}}





















































































test cmdr-help-1.1 {help structure, inverted boolean option} -body {
    cmdr create x foo {
	description TEST
	private nail {
	    description workbench
	    option no-driver force { list ; alias force }
	} ::wall
    }
    x help
} -cleanup {
    x destroy
} -result {nail {desc workbench options {--driver {Complementary alias of --no-driver.} --force {Alias of --no-driver.} --no-driver force} arguments {} states {} parameters {no-driver {cmdline 1 code ?* default {} defered 0 description force documented yes flags {--force alias --no-driver primary --driver inverted} generator {} interactive no isbool 1 list yes ordered 0 presence no prompt {Enter no-driver: } required 0 threshold {} type option validator ::cmdr::validate::boolean}} action ::wall} help {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--short {


		Activate short form of the help.
	    } --list {
		Activate list form of the help.
	    } --full {
		Activate full form of the help.
	    }} arguments cmdname states format parameters {short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} full {cmdline 1 code ? default no defered 0 description {


		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} format {cmdline 0 code {} default full defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --short, --list, and --full.
	} documented yes flags {} generator {} interactive no isbool 0 list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity}} action {::cmdr::help::auto-help ::x}}}














# # ## ### ##### ######## ############# #####################

test cmdr-help-2.0 {full - formatting help structure} -body {
    HelpLarge full
} -result {bar aloha [OPTIONS] yoyo ?jump? run...
    hawaii

    --lulu    loop
    --no-lulu Complementary alias of --lulu.

    yoyo height
    jump gate
    run  lane

bar help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

snafu aloha [OPTIONS] yoyo ?jump? run...
    hawaii

    --lulu    loop
    --no-lulu Complementary alias of --lulu.

    yoyo height
    jump gate
    run  lane

snafu help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

tool pliers help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

tool hammer nail [OPTIONS] ?supply...?
    workbench

    --driver force
    --force  Alias of --driver.

    supply magazine

tool hammer help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

tool help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

hammer nail [OPTIONS] ?supply...?
    workbench

    --driver force
    --force  Alias of --driver.

    supply magazine

hammer help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.
}

test cmdr-help-2.1 {full formatting - help structure, inverted boolean option} -body {
................................................................................
    workbench

    --driver    Complementary alias of
                --no-driver.
    --force     Alias of --no-driver.
    --no-driver force

help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.



    --short Activate short form of the help.
    --list  Activate list form of the help.
    --full  Activate full form of the help.






    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.
}

# # ## ### ##### ######## ############# #####################

test cmdr-help-3.0 {short - formatting help structure} -body {
    HelpLarge short
} -result {bar aloha [OPTIONS] yoyo ?jump? run...
    hawaii

bar help [OPTIONS] ?cmdname...?





















    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

snafu aloha [OPTIONS] yoyo ?jump? run...
    hawaii

snafu help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

tool pliers help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

tool hammer nail [OPTIONS] ?supply...?
    workbench

tool hammer help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

tool help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

hammer nail [OPTIONS] ?supply...?
    workbench

hammer help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.
}

test cmdr-help-3.1 {short formatting - help structure, inverted boolean option} -body {
    HelpSmall short
} -result {nail [OPTIONS]
    workbench

help [OPTIONS] ?cmdname...?
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.
}

# # ## ### ##### ######## ############# #####################

test cmdr-help-4.0 {list - formatting help structure} -body {
    HelpLarge list
} -result {    bar aloha [OPTIONS] yoyo ?jump? run...
    bar help [OPTIONS] ?cmdname...?
    snafu aloha [OPTIONS] yoyo ?jump? run...
    snafu help [OPTIONS] ?cmdname...?
    tool pliers help [OPTIONS] ?cmdname...?
    tool hammer nail [OPTIONS] ?supply...?
    tool hammer help [OPTIONS] ?cmdname...?
    tool help [OPTIONS] ?cmdname...?
    hammer nail [OPTIONS] ?supply...?
    hammer help [OPTIONS] ?cmdname...?
    help [OPTIONS] ?cmdname...?}

test cmdr-help-4.1 {list formatting - help structure, inverted boolean option} -body {
    HelpSmall list
} -result {    nail [OPTIONS]
    help [OPTIONS] ?cmdname...?}

# # ## ### ##### ######## ############# #####################
return







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












|

|
>
>
|


|
<
<

|
|
|
>
>
|
<
<
|
<



|
>
>
>
>
>
>
>
>
>
>
>
>
>





|









|




>
>
|
|
|
>
>
>
>
>





|









|




>
>
|
|
|
>
>
>
>
>





|




>
>
|
|
|
>
>
>
>
>





|







|




>
>
|
|
|
>
>
>
>
>





|




>
>
|
|
|
>
>
>
>
>





|







|




>
>
|
|
|
>
>
>
>
>





|




>
>
|
|
|
>
>
>
>
>







 







|




>
>
|
|
|
>
>
>
>
>










|


|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




<
<
<
|




<
<
<
<
<
|


|




<
<
<
<
<
<
<
<
<
<
<
<
<
|










|









|
|
|
|
|
|
|
|
|
|
|




|



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298


299
300
301
302
303
304
305


306

307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
...
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569



570
571
572
573
574





575
576
577
578
579
580
581
582













583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
	    private cloak {} ::dagger
	}
    }

    regsub -all {::oo::Obj\d+::} [x help] {ZZZ::}
} -cleanup {
    x destroy
} -result {{bar aloha} {desc hawaii options {--lulu loop --no-lulu {Complementary alias of --lulu.}} opt2para {--lulu lulu --no-lulu lulu} arguments {yoyo jump run} states {} parameters {jump {cmdline 1 code ? default {} defered 0 description gate documented yes flags {} generator {} interactive no isbool 0 label jump list no ordered 1 presence no prompt {Enter jump: } required no threshold 1 type input validator ::cmdr::validate::identity} lulu {cmdline 1 code ? default no defered 0 description loop documented yes flags {--lulu primary --no-lulu inverted} generator {} interactive no isbool 1 label lulu list no ordered 0 presence no prompt {Enter lulu: } required 0 threshold {} type option validator ::cmdr::validate::boolean} run {cmdline 1 code +* default {} defered 0 description lane documented yes flags {} generator {} interactive no isbool 0 label run list yes ordered 1 presence no prompt {Enter run: } required 1 threshold {} type input validator ::cmdr::validate::identity} yoyo {cmdline 1 code + default {} defered 0 description height documented yes flags {} generator {} interactive no isbool 0 label yoyo list no ordered 1 presence no prompt {Enter yoyo: } required 1 threshold {} type input validator ::cmdr::validate::identity}} sections {} action ::hula} {bar help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {
		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.
	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ZZZ::officer_bar}} {snafu aloha} {desc hawaii options {--lulu loop --no-lulu {Complementary alias of --lulu.}} opt2para {--lulu lulu --no-lulu lulu} arguments {yoyo jump run} states {} parameters {jump {cmdline 1 code ? default {} defered 0 description gate documented yes flags {} generator {} interactive no isbool 0 label jump list no ordered 1 presence no prompt {Enter jump: } required no threshold 1 type input validator ::cmdr::validate::identity} lulu {cmdline 1 code ? default no defered 0 description loop documented yes flags {--lulu primary --no-lulu inverted} generator {} interactive no isbool 1 label lulu list no ordered 0 presence no prompt {Enter lulu: } required 0 threshold {} type option validator ::cmdr::validate::boolean} run {cmdline 1 code +* default {} defered 0 description lane documented yes flags {} generator {} interactive no isbool 0 label run list yes ordered 1 presence no prompt {Enter run: } required 1 threshold {} type input validator ::cmdr::validate::identity} yoyo {cmdline 1 code + default {} defered 0 description height documented yes flags {} generator {} interactive no isbool 0 label yoyo list no ordered 1 presence no prompt {Enter yoyo: } required 1 threshold {} type input validator ::cmdr::validate::identity}} sections {} action ::hula} {snafu help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {
		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.
	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ZZZ::officer_bar}} {tool pliers help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {
		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.
	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ZZZ::officer_pliers}} {tool hammer nail} {desc workbench options {--driver force --force {Alias of --driver.}} opt2para {--driver driver --force driver} arguments supply states context parameters {context {cmdline 0 code {} default {} defered 1 description orientation documented yes flags {} generator {} interactive no isbool 0 label context list no ordered 0 presence no prompt {Enter context: } required 1 threshold {} type state validator ::cmdr::validate::identity} driver {cmdline 1 code ?* default 0 defered 0 description force documented yes flags {--force alias --driver primary} generator {} interactive no isbool 0 label driver list yes ordered 0 presence no prompt {Enter driver: } required 0 threshold {} type option validator adouble} supply {cmdline 1 code ?* default {} defered 0 description magazine documented yes flags {} generator {} interactive no isbool 0 label supply list yes ordered 1 presence no prompt {Enter supply: } required no threshold 0 type input validator ::cmdr::validate::identity}} sections {} action ::wall} {tool hammer help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {
		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.
	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ZZZ::officer_hammer}} {tool help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {
		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.
	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ZZZ::officer_tool}} {hammer nail} {desc workbench options {--driver force --force {Alias of --driver.}} opt2para {--driver driver --force driver} arguments supply states context parameters {context {cmdline 0 code {} default {} defered 1 description orientation documented yes flags {} generator {} interactive no isbool 0 label context list no ordered 0 presence no prompt {Enter context: } required 1 threshold {} type state validator ::cmdr::validate::identity} driver {cmdline 1 code ?* default 0 defered 0 description force documented yes flags {--force alias --driver primary} generator {} interactive no isbool 0 label driver list yes ordered 0 presence no prompt {Enter driver: } required 0 threshold {} type option validator adouble} supply {cmdline 1 code ?* default {} defered 0 description magazine documented yes flags {} generator {} interactive no isbool 0 label supply list yes ordered 1 presence no prompt {Enter supply: } required no threshold 0 type input validator ::cmdr::validate::identity}} sections {} action ::wall} {hammer help} {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {
		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.
	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ZZZ::officer_hammer}} help {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {
		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.
	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ::x}}}

test cmdr-help-1.1 {help structure, inverted boolean option} -body {
    cmdr create x foo {
	description TEST
	private nail {
	    description workbench
	    option no-driver force { list ; alias force }
	} ::wall
    }
    x help
} -cleanup {
    x destroy
} -result {nail {desc workbench options {--driver {Complementary alias of --no-driver.} --force {Alias of --no-driver.} --no-driver force} opt2para {--driver no-driver --force no-driver --no-driver no-driver} arguments {} states {} parameters {no-driver {cmdline 1 code ?* default {} defered 0 description force documented yes flags {--force alias --no-driver primary --driver inverted} generator {} interactive no isbool 1 label no-driver list yes ordered 0 presence no prompt {Enter no-driver: } required 0 threshold {} type option validator ::cmdr::validate::boolean}} sections {} action ::wall} help {desc {Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.} options {--by-category {
		Activate by-category form of the help.
	    } --full {
		Activate full form of the help.
	    } --list {
		Activate list form of the help.
	    } --short {


		Activate short form of the help.
	    } --width {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} -w {Alias of --width.}} opt2para {--by-category by-category --full full --list list --short short --width width -w width} arguments cmdname states format parameters {by-category {cmdline 1 code ? default no defered 0 description {
		Activate by-category form of the help.


	    } documented yes flags {--by-category primary} generator {} interactive no isbool 1 label by-category list no ordered 0 presence yes prompt {Enter by-category: } required 0 threshold {} type option validator ::cmdr::validate::boolean} cmdname {cmdline 1 code ?* default {} defered 0 description {

	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} documented yes flags {} generator {} interactive no isbool 0 label cmdname list yes ordered 1 presence no prompt {Enter cmdname: } required no threshold 0 type input validator ::cmdr::validate::identity} format {cmdline 0 code {} default {} defered 1 description {
	    Format of the help to generate.
	    This field is fed by the options --by-category, --full, --list, and --short.
	} documented yes flags {} generator {} interactive no isbool 0 label format list no ordered 0 presence no prompt {Enter format: } required 1 threshold {} type state validator ::cmdr::validate::identity} full {cmdline 1 code ? default no defered 0 description {
		Activate full form of the help.
	    } documented yes flags {--full primary} generator {} interactive no isbool 1 label full list no ordered 0 presence yes prompt {Enter full: } required 0 threshold {} type option validator ::cmdr::validate::boolean} list {cmdline 1 code ? default no defered 0 description {
		Activate list form of the help.
	    } documented yes flags {--list primary} generator {} interactive no isbool 1 label list list no ordered 0 presence yes prompt {Enter list: } required 0 threshold {} type option validator ::cmdr::validate::boolean} short {cmdline 1 code ? default no defered 0 description {
		Activate short form of the help.
	    } documented yes flags {--short primary} generator {} interactive no isbool 1 label short list no ordered 0 presence yes prompt {Enter short: } required 0 threshold {} type option validator ::cmdr::validate::boolean} width {cmdline 1 code ? default {} defered 0 description {
	    The line width to format the help for.
	    Defaults to the terminal width, or 80 when
	    no terminal is available.
	} documented yes flags {-w alias --width primary} generator {::apply {p { linenoise columns }}} interactive no isbool 0 label width list no ordered 0 presence no prompt {Enter width: } required 0 threshold {} type option validator ::cmdr::validate::integer}} sections {} action {::cmdr::help::auto-help ::x}}}

# # ## ### ##### ######## ############# #####################

test cmdr-help-2.0 {full - formatting help structure} -body {
    HelpLarge full
} -result {bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
    hawaii

    --lulu    loop
    --no-lulu Complementary alias of --lulu.

    yoyo height
    jump gate
    run  lane

bar help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
    hawaii

    --lulu    loop
    --no-lulu Complementary alias of --lulu.

    yoyo height
    jump gate
    run  lane

snafu help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

tool pliers help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

tool hammer nail [OPTIONS] [<supply>...]
    workbench

    --driver force
    --force  Alias of --driver.

    supply magazine

tool hammer help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

tool help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

hammer nail [OPTIONS] [<supply>...]
    workbench

    --driver force
    --force  Alias of --driver.

    supply magazine

hammer help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.

help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.
}

test cmdr-help-2.1 {full formatting - help structure, inverted boolean option} -body {
................................................................................
    workbench

    --driver    Complementary alias of
                --no-driver.
    --force     Alias of --no-driver.
    --no-driver force

help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

    --by-category Activate by-category form of the
                  help.
    --full        Activate full form of the help.
    --list        Activate list form of the help.
    --short       Activate short form of the help.
    --width       The line width to format the
                  help for. Defaults to the
                  terminal width, or 80 when no
                  terminal is available.
    -w            Alias of --width.

    cmdname The entire command line, the name of
            the command to get help for. This can
            be several words.
}

# # ## ### ##### ######## ############# #####################

test cmdr-help-3.0 {short - formatting help structure} -body {
    HelpLarge short
} -result {bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
    hawaii

bar help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
    hawaii

snafu help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

tool pliers help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.

tool hammer nail [OPTIONS] [<supply>...]
    workbench

tool hammer help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.




tool help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.






hammer nail [OPTIONS] [<supply>...]
    workbench

hammer help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.














help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.
}

test cmdr-help-3.1 {short formatting - help structure, inverted boolean option} -body {
    HelpSmall short
} -result {nail [OPTIONS]
    workbench

help [OPTIONS] [<cmdname>...]
    Retrieve help for a command or command set.
    Without arguments help for all commands is
    given. The default format is --full.
}

# # ## ### ##### ######## ############# #####################

test cmdr-help-4.0 {list - formatting help structure} -body {
    HelpLarge list
} -result {    bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
    bar help [OPTIONS] [<cmdname>...]
    snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
    snafu help [OPTIONS] [<cmdname>...]
    tool pliers help [OPTIONS] [<cmdname>...]
    tool hammer nail [OPTIONS] [<supply>...]
    tool hammer help [OPTIONS] [<cmdname>...]
    tool help [OPTIONS] [<cmdname>...]
    hammer nail [OPTIONS] [<supply>...]
    hammer help [OPTIONS] [<cmdname>...]
    help [OPTIONS] [<cmdname>...]}

test cmdr-help-4.1 {list formatting - help structure, inverted boolean option} -body {
    HelpSmall list
} -result {    nail [OPTIONS]
    help [OPTIONS] [<cmdname>...]}

# # ## ### ##### ######## ############# #####################
return

Changes to tests/runtime.tests.

358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
...
617
618
619
620
621
622
623
624
625
626
627
628
	option C -
	option D -
	option E -
	option F -
	option G - { validate identity }
    } -A -G X --no-B -G X -C 1 -D 0 --no-E 1 --no-F 0
} -result {
    A = 'yes' v'yes'
    B = '0'   v'0'
    C = '1'   v'1'
    D = '0'   v'0'
    E = '0'   v'0'
    F = '1'   v'1'
    G = 'X'   v'X'
}
................................................................................

test cmdr-runtime-7.2 {validation errors} -body {
    ParseFailParse {
	input A - { validate integer }
	input B - { validate integer }
    } 1 X
} -returnCodes error \
    -result {Expected an integer for "B", got "X"}

# # ## ### ##### ######## ############# #####################

return







|







 







|




358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
...
617
618
619
620
621
622
623
624
625
626
627
628
	option C -
	option D -
	option E -
	option F -
	option G - { validate identity }
    } -A -G X --no-B -G X -C 1 -D 0 --no-E 1 --no-F 0
} -result {
    A = 'yes' v'1'
    B = '0'   v'0'
    C = '1'   v'1'
    D = '0'   v'0'
    E = '0'   v'0'
    F = '1'   v'1'
    G = 'X'   v'X'
}
................................................................................

test cmdr-runtime-7.2 {validation errors} -body {
    ParseFailParse {
	input A - { validate integer }
	input B - { validate integer }
    } 1 X
} -returnCodes error \
    -result {Expected an integer for input "B", got "X"}

# # ## ### ##### ######## ############# #####################

return

Changes to tests/support.tcl.

27
28
29
30
31
32
33

34

35
36
37
38
39
40
41
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
	default
	alias snafu
	officer tool {
	    officer pliers {}
	    officer hammer {
		private nail {
		    description workbench

		    option driver force { validate adouble ; default 0 ; list ; alias force }

		    state  context orientation
		    input supply magazine { list ; optional }
		} ::wall
	    }
	    default hammer
	}
	alias hammer = tool hammer
................................................................................
	} ::wall
    } $format $n
}

proc Help {def format n} {
    try {
	cmdr create x foo $def
	cmdr help format $format $n [x help]
    } finally {
	x destroy
    }
}

# # ## ### ##### ######## ############# #####################
## Supporting procedures for cmdr.test et. al.







>
|
>







 







|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
..
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
	default
	alias snafu
	officer tool {
	    officer pliers {}
	    officer hammer {
		private nail {
		    description workbench
		    option driver force {
			validate adouble ; default 0 ; list ; alias force
		    }
		    state  context orientation
		    input supply magazine { list ; optional }
		} ::wall
	    }
	    default hammer
	}
	alias hammer = tool hammer
................................................................................
	} ::wall
    } $format $n
}

proc Help {def format n} {
    try {
	cmdr create x foo $def
	cmdr help format $format x $n [x help]
    } finally {
	x destroy
    }
}

# # ## ### ##### ######## ############# #####################
## Supporting procedures for cmdr.test et. al.

Changes to util.tcl.

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
55
56
57
58
59
60
61








62
63
64
65

namespace eval ::cmdr {
    namespace export util
    namespace ensemble create
}

namespace eval ::cmdr::util {
    namespace export padr
    namespace ensemble create
}

# # ## ### ##### ######## ############# #####################

debug define cmdr/util
debug level  cmdr/util
................................................................................
	if {$l <= $maxl} continue
	set maxl $l
    }
    set res {}
    foreach str $list { lappend res [format "%-*s" $maxl $str] }
    return $res
}









# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::util 0.11







|







 







>
>
>
>
>
>
>
>



|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

namespace eval ::cmdr {
    namespace export util
    namespace ensemble create
}

namespace eval ::cmdr::util {
    namespace export padr dictsort
    namespace ensemble create
}

# # ## ### ##### ######## ############# #####################

debug define cmdr/util
debug level  cmdr/util
................................................................................
	if {$l <= $maxl} continue
	set maxl $l
    }
    set res {}
    foreach str $list { lappend res [format "%-*s" $maxl $str] }
    return $res
}

proc ::cmdr::util::dictsort {dict} {
    set r {}
    foreach k [lsort -dict [dict keys $dict]] {
	lappend r $k [dict get $dict $k]
    }
    return $r
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::util 0.12

Changes to validate.tcl.

317
318
319
320
321
322
323
324
325
    if {![file readable    $path]} {return 0}
    if {![file writable    $path]} {return 0}
    return 1
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate 0.11
return







|

317
318
319
320
321
322
323
324
325
    if {![file readable    $path]} {return 0}
    if {![file writable    $path]} {return 0}
    return 1
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate 0.12
return

Changes to vcommon.tcl.

105
106
107
108
109
110
111
112
113

    debug.cmdr/validate/common {= [join $candidates "\n= "]} 10
    return $candidates
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate::common 0.11
return







|

105
106
107
108
109
110
111
112
113

    debug.cmdr/validate/common {= [join $candidates "\n= "]} 10
    return $candidates
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate::common 0.12
return