Index: actor.tcl ================================================================== --- actor.tcl +++ actor.tcl @@ -311,6 +311,6 @@ # # ## ### ##### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::actor 0.11 +package provide cmdr::actor 0.12 Index: cmdr.tcl ================================================================== --- cmdr.tcl +++ cmdr.tcl @@ -73,6 +73,6 @@ return $interactive } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr 0.11 +package provide cmdr 0.12 Index: config.tcl ================================================================== --- config.tcl +++ config.tcl @@ -178,10 +178,14 @@ ![$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, @@ -188,11 +192,11 @@ # not just bits and pieces. set states {} set parameters {} - foreach p $mynames { + 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 @@ -1354,6 +1358,6 @@ # # ## ### ##### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::config 0.11 +package provide cmdr::config 0.12 Index: doc/cmdr_util.man ================================================================== --- doc/cmdr_util.man +++ doc/cmdr_util.man @@ -5,11 +5,11 @@ [require cmdr::util] [titledesc [vset TITLE_UTIL]] [description] [include parts/welcome.inc] -This internal package provides a single utility command. +This internal package provides a few utility commands. [section API] [list_begin definitions] [comment {- - -- --- ----- -------- -------------}] [call [cmd ::cmdr::util] [method padr] [arg list]] @@ -24,9 +24,20 @@ [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] Index: embedded/man/files/cmdr_util.n ================================================================== --- embedded/man/files/cmdr_util.n +++ embedded/man/files/cmdr_util.n @@ -246,18 +246,20 @@ .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 single utility command\&. +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 @@ -269,10 +271,20 @@ .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 Index: embedded/www/doc/files/cmdr_util.html ================================================================== --- embedded/www/doc/files/cmdr_util.html +++ embedded/www/doc/files/cmdr_util.html @@ -125,17 +125,18 @@

Description

Welcome to the Cmdr project, written by Andreas Kupries.

For availability please read Cmdr - How To Get The Sources.

-

This internal package provides a single utility command.

+

This internal package provides a few utility commands.

API

::cmdr::util padr list

When invoked this command pads all elements of the specified @@ -145,10 +146,17 @@

The modified list is returned as the result of the command.

list list

A list of strings to normalize in length by appending space characters as needed.

+
+
::cmdr::util dictsort dict
+

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

+

The modified dictionary is returned as the result of the command.

+
+
dictionary dict
+

The dictionary to sort.

Bugs, Ideas, Feedback

Both the package(s) and this documentation will undoubtedly contain Index: help.tcl ================================================================== --- help.tcl +++ help.tcl @@ -90,12 +90,16 @@ 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]*}] { + 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. } { @@ -154,22 +158,14 @@ } else { set format by-category } } - puts [format $format [$actor root] $width [DictSort [query $actor $words]]] + puts [format $format [$actor root] $width [cmdr util 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 @@ -223,11 +219,11 @@ # plus per-option descriptions (sort by flag name) if {[dict size $options]} { set onames {} set odefs {} - foreach {oname ohelp} [::cmdr::help::DictSort $options] { + foreach {oname ohelp} [::cmdr util dictsort $options] { lappend onames $oname lappend odefs $ohelp } DefList $width $onames $odefs } @@ -414,11 +410,11 @@ 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}>..." } ?* { set text "\[<${label}>...\]" } } lappend result $text } return [join $result] @@ -512,6 +508,6 @@ } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::help 0.11 +package provide cmdr::help 0.12 Index: help_json.tcl ================================================================== --- help_json.tcl +++ help_json.tcl @@ -3,31 +3,33 @@ ## 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 +# 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 +# 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 +package require cmdr::help 0.12 +package require cmdr::util 0.12 package require json::write # # ## ### ##### ######## ############# ##################### debug define cmdr/help/json @@ -121,13 +123,13 @@ return [json::write object {*}$dict] } proc ::cmdr::help::format::JSON::parameters {parameters} { set dict {} - foreach {name def} [::cmdr::help::DictSort $parameters] { + foreach {name def} [::cmdr util dictsort $parameters] { set tmp {} - foreach {xname xdef} [::cmdr::help::DictSort $def] { + foreach {xname xdef} [::cmdr util dictsort $def] { switch -glob -- $xname { cmdline - defered - documented - interactive - @@ -184,11 +186,11 @@ return [json::write array {*}$tmp] } proc ::cmdr::help::format::JSON::adict {thedict} { set tmp {} - foreach {k v} [::cmdr::help::DictSort $thedict] { + foreach {k v} [::cmdr util dictsort $thedict] { lappend tmp $k [json::write string $v] } return [json::write object {*}$tmp] } @@ -197,6 +199,6 @@ return [json::write string [string trim $string]] } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::help::json 0.1 +package provide cmdr::help::json 0.2 Index: help_sql.tcl ================================================================== --- help_sql.tcl +++ help_sql.tcl @@ -3,30 +3,32 @@ ## 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 +# 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 +# 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 +package require cmdr::help 0.12 +package require cmdr::util 0.12 # # ## ### ##### ######## ############# ##################### debug define cmdr/help/sql debug level cmdr/help/sql @@ -152,11 +154,11 @@ } proc ::cmdr::help::format::SQL::para {def} { set result {} - foreach {xname xdef} [::cmdr::help::DictSort $def] { + foreach {xname xdef} [::cmdr util dictsort $def] { switch -glob -- $xname { cmdline - defered - documented - interactive - @@ -289,6 +291,6 @@ CREATE INDEX fname on flags ( name ); } } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::help::sql 0.1 +package provide cmdr::help::sql 0.2 Index: officer.tcl ================================================================== --- officer.tcl +++ officer.tcl @@ -616,6 +616,6 @@ # # ## ### ##### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::officer 0.10 +package provide cmdr::officer 0.12 Index: parameter.tcl ================================================================== --- parameter.tcl +++ parameter.tcl @@ -1187,6 +1187,6 @@ # # ## ### ##### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::parameter 0.11 +package provide cmdr::parameter 0.12 Index: private.tcl ================================================================== --- private.tcl +++ private.tcl @@ -167,6 +167,6 @@ # # ## ### ##### ######## ############# } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::private 0.11 +package provide cmdr::private 0.12 Index: tests/help.tests ================================================================== --- tests/help.tests +++ tests/help.tests @@ -41,158 +41,242 @@ } 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}}} +} -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 { @@ -201,159 +285,220 @@ } ::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. +} -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 {--short { - Activate short form of the help. - } --list { - Activate list form of the help. + The default format is --full.} options {--by-category { + Activate by-category 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 { + } --list { 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 { + } --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 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}}} + } 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... +} -result {bar aloha [OPTIONS] [] ... hawaii --lulu loop --no-lulu Complementary alias of --lulu. yoyo height jump gate run lane -bar help [OPTIONS] ?cmdname...? +bar help [OPTIONS] [...] 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. + --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... +snafu aloha [OPTIONS] [] ... hawaii --lulu loop --no-lulu Complementary alias of --lulu. yoyo height jump gate run lane -snafu help [OPTIONS] ?cmdname...? +snafu help [OPTIONS] [...] 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. + --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...? +tool pliers help [OPTIONS] [...] 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. + --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...? +tool hammer nail [OPTIONS] [...] workbench --driver force --force Alias of --driver. supply magazine -tool hammer help [OPTIONS] ?cmdname...? +tool hammer help [OPTIONS] [...] 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. + --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...? +tool help [OPTIONS] [...] 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. + --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...? +hammer nail [OPTIONS] [...] workbench --driver force --force Alias of --driver. supply magazine -hammer help [OPTIONS] ?cmdname...? +hammer help [OPTIONS] [...] 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. + --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...? +help [OPTIONS] [...] 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. + --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. } @@ -366,18 +511,25 @@ --driver Complementary alias of --no-driver. --force Alias of --no-driver. --no-driver force -help [OPTIONS] ?cmdname...? +help [OPTIONS] [...] 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. + --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. } @@ -384,53 +536,53 @@ # # ## ### ##### ######## ############# ##################### 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...? +} -result {bar aloha [OPTIONS] [] ... + hawaii + +bar help [OPTIONS] [...] + Retrieve help for a command or command set. + Without arguments help for all commands is + given. The default format is --full. + +snafu aloha [OPTIONS] [] ... + hawaii + +snafu help [OPTIONS] [...] + 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] [...] + 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] [...] + workbench + +tool hammer help [OPTIONS] [...] + Retrieve help for a command or command set. + Without arguments help for all commands is + given. The default format is --full. + +tool help [OPTIONS] [...] + Retrieve help for a command or command set. + Without arguments help for all commands is + given. The default format is --full. + +hammer nail [OPTIONS] [...] + workbench + +hammer help [OPTIONS] [...] + Retrieve help for a command or command set. + Without arguments help for all commands is + given. The default format is --full. + +help [OPTIONS] [...] Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. } @@ -437,34 +589,34 @@ test cmdr-help-3.1 {short formatting - help structure, inverted boolean option} -body { HelpSmall short } -result {nail [OPTIONS] workbench -help [OPTIONS] ?cmdname...? +help [OPTIONS] [...] 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...?} +} -result { bar aloha [OPTIONS] [] ... + bar help [OPTIONS] [...] + snafu aloha [OPTIONS] [] ... + snafu help [OPTIONS] [...] + tool pliers help [OPTIONS] [...] + tool hammer nail [OPTIONS] [...] + tool hammer help [OPTIONS] [...] + tool help [OPTIONS] [...] + hammer nail [OPTIONS] [...] + hammer help [OPTIONS] [...] + help [OPTIONS] [...]} test cmdr-help-4.1 {list formatting - help structure, inverted boolean option} -body { HelpSmall list } -result { nail [OPTIONS] - help [OPTIONS] ?cmdname...?} + help [OPTIONS] [...]} # # ## ### ##### ######## ############# ##################### return Index: tests/runtime.tests ================================================================== --- tests/runtime.tests +++ tests/runtime.tests @@ -360,11 +360,11 @@ 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' + A = 'yes' v'1' B = '0' v'0' C = '1' v'1' D = '0' v'0' E = '0' v'0' F = '1' v'1' @@ -619,10 +619,10 @@ ParseFailParse { input A - { validate integer } input B - { validate integer } } 1 X } -returnCodes error \ - -result {Expected an integer for "B", got "X"} + -result {Expected an integer for input "B", got "X"} # # ## ### ##### ######## ############# ##################### return Index: tests/support.tcl ================================================================== --- tests/support.tcl +++ tests/support.tcl @@ -29,11 +29,13 @@ officer tool { officer pliers {} officer hammer { private nail { description workbench - option driver force { validate adouble ; default 0 ; list ; alias force } + option driver force { + validate adouble ; default 0 ; list ; alias force + } state context orientation input supply magazine { list ; optional } } ::wall } default hammer @@ -62,11 +64,11 @@ } proc Help {def format n} { try { cmdr create x foo $def - cmdr help format $format $n [x help] + cmdr help format $format x $n [x help] } finally { x destroy } } Index: util.tcl ================================================================== --- util.tcl +++ util.tcl @@ -30,11 +30,11 @@ namespace export util namespace ensemble create } namespace eval ::cmdr::util { - namespace export padr + namespace export padr dictsort namespace ensemble create } # # ## ### ##### ######## ############# ##################### @@ -57,9 +57,17 @@ } 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.11 +package provide cmdr::util 0.12 Index: validate.tcl ================================================================== --- validate.tcl +++ validate.tcl @@ -319,7 +319,7 @@ return 1 } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::validate 0.11 +package provide cmdr::validate 0.12 return Index: vcommon.tcl ================================================================== --- vcommon.tcl +++ vcommon.tcl @@ -107,7 +107,7 @@ return $candidates } # # ## ### ##### ######## ############# ##################### ## Ready -package provide cmdr::validate::common 0.11 +package provide cmdr::validate::common 0.12 return