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

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

Overview
Comment:Updated tests to match the new auto-exit command.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:48291542b349a9e05bfd9455a86aba52eca094d2
User & Date: aku 2014-02-06 06:00:17
Context
2014-02-06
06:18
Remade "help::query-actor" as method "find" of officers and private. Simplified the internals of auto-help. Provides the path lookup to framework users as well. Updated the documentation. check-in: 5487358492 user: aku tags: trunk
06:00
Updated tests to match the new auto-exit command. check-in: 48291542b3 user: aku tags: trunk
05:35
Added utility package cmdr::help::tcl, dumping the help as Tcl data structure. Like cmdr::help::json, with less overhead to read into other Tcl code. check-in: 865912b8d9 user: aku tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tests/help.tests.

    72     72   		Activate list form of the help.
    73     73   	    } 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 {
    74     74   		Activate short form of the help.
    75     75   	    } 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 {
    76     76   	    The line width to format the help for.
    77     77   	    Defaults to the terminal width, or 80 when
    78     78   	    no terminal is available.
    79         -	} 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.
           79  +	} 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}} {bar exit} {desc {Exit the shell.
           80  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {ZZZ::my shell-exit}} {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.
           81  +	    Without arguments help for all commands is given.
           82  +	    The default format is --full.} options {--by-category {
           83  +		Activate by-category form of the help.
           84  +	    } --full {
           85  +		Activate full form of the help.
           86  +	    } --list {
           87  +		Activate list form of the help.
           88  +	    } --short {
           89  +		Activate short form of the help.
           90  +	    } --width {
           91  +	    The line width to format the help for.
           92  +	    Defaults to the terminal width, or 80 when
           93  +	    no terminal is available.
           94  +	} -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 {
           95  +		Activate by-category form of the help.
           96  +	    } 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 {
           97  +	    The entire command line, the name of the
           98  +	    command to get help for. This can be several
           99  +	    words.
          100  +	} 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 {
          101  +	    Format of the help to generate.
          102  +	    This field is fed by the options --by-category, --full, --list, and --short.
          103  +	} 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 {
          104  +		Activate full form of the help.
          105  +	    } 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 {
          106  +		Activate list form of the help.
          107  +	    } 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 {
          108  +		Activate short form of the help.
          109  +	    } 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 {
          110  +	    The line width to format the help for.
          111  +	    Defaults to the terminal width, or 80 when
          112  +	    no terminal is available.
          113  +	} 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 exit} {desc {Exit the shell.
          114  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {ZZZ::my shell-exit}} {tool pliers help} {desc {Retrieve help for a command or command set.
          115  +	    Without arguments help for all commands is given.
          116  +	    The default format is --full.} options {--by-category {
          117  +		Activate by-category form of the help.
          118  +	    } --full {
          119  +		Activate full form of the help.
          120  +	    } --list {
          121  +		Activate list form of the help.
          122  +	    } --short {
          123  +		Activate short form of the help.
          124  +	    } --width {
          125  +	    The line width to format the help for.
          126  +	    Defaults to the terminal width, or 80 when
          127  +	    no terminal is available.
          128  +	} -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 {
          129  +		Activate by-category form of the help.
          130  +	    } 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 {
          131  +	    The entire command line, the name of the
          132  +	    command to get help for. This can be several
          133  +	    words.
          134  +	} 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 {
          135  +	    Format of the help to generate.
          136  +	    This field is fed by the options --by-category, --full, --list, and --short.
          137  +	} 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 {
          138  +		Activate full form of the help.
          139  +	    } 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 {
          140  +		Activate list form of the help.
          141  +	    } 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 {
          142  +		Activate short form of the help.
          143  +	    } 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 {
          144  +	    The line width to format the help for.
          145  +	    Defaults to the terminal width, or 80 when
          146  +	    no terminal is available.
          147  +	} 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 pliers exit} {desc {Exit the shell.
          148  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {ZZZ::my shell-exit}} {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.
          149  +	    Without arguments help for all commands is given.
          150  +	    The default format is --full.} options {--by-category {
          151  +		Activate by-category form of the help.
          152  +	    } --full {
          153  +		Activate full form of the help.
          154  +	    } --list {
          155  +		Activate list form of the help.
          156  +	    } --short {
          157  +		Activate short form of the help.
          158  +	    } --width {
          159  +	    The line width to format the help for.
          160  +	    Defaults to the terminal width, or 80 when
          161  +	    no terminal is available.
          162  +	} -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 {
          163  +		Activate by-category form of the help.
          164  +	    } 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 {
          165  +	    The entire command line, the name of the
          166  +	    command to get help for. This can be several
          167  +	    words.
          168  +	} 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 {
          169  +	    Format of the help to generate.
          170  +	    This field is fed by the options --by-category, --full, --list, and --short.
          171  +	} 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 {
          172  +		Activate full form of the help.
          173  +	    } 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 {
          174  +		Activate list form of the help.
          175  +	    } 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 {
          176  +		Activate short form of the help.
          177  +	    } 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 {
          178  +	    The line width to format the help for.
          179  +	    Defaults to the terminal width, or 80 when
          180  +	    no terminal is available.
          181  +	} 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 hammer exit} {desc {Exit the shell.
          182  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {ZZZ::my shell-exit}} {tool help} {desc {Retrieve help for a command or command set.
    80    183   	    Without arguments help for all commands is given.
    81    184   	    The default format is --full.} options {--by-category {
    82    185   		Activate by-category form of the help.
    83    186   	    } --full {
    84    187   		Activate full form of the help.
    85    188   	    } --list {
    86    189   		Activate list form of the help.
................................................................................
   105    208   		Activate list form of the help.
   106    209   	    } 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 {
   107    210   		Activate short form of the help.
   108    211   	    } 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 {
   109    212   	    The line width to format the help for.
   110    213   	    Defaults to the terminal width, or 80 when
   111    214   	    no terminal is available.
   112         -	} 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.
          215  +	} 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}} {tool exit} {desc {Exit the shell.
          216  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {ZZZ::my shell-exit}} {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.
   113    217   	    Without arguments help for all commands is given.
   114    218   	    The default format is --full.} options {--by-category {
   115    219   		Activate by-category form of the help.
   116    220   	    } --full {
   117    221   		Activate full form of the help.
   118    222   	    } --list {
   119    223   		Activate list form of the help.
................................................................................
   138    242   		Activate list form of the help.
   139    243   	    } 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 {
   140    244   		Activate short form of the help.
   141    245   	    } 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 {
   142    246   	    The line width to format the help for.
   143    247   	    Defaults to the terminal width, or 80 when
   144    248   	    no terminal is available.
   145         -	} 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.
   146         -	    Without arguments help for all commands is given.
   147         -	    The default format is --full.} options {--by-category {
   148         -		Activate by-category form of the help.
   149         -	    } --full {
   150         -		Activate full form of the help.
   151         -	    } --list {
   152         -		Activate list form of the help.
   153         -	    } --short {
   154         -		Activate short form of the help.
   155         -	    } --width {
   156         -	    The line width to format the help for.
   157         -	    Defaults to the terminal width, or 80 when
   158         -	    no terminal is available.
   159         -	} -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 {
   160         -		Activate by-category form of the help.
   161         -	    } 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 {
   162         -	    The entire command line, the name of the
   163         -	    command to get help for. This can be several
   164         -	    words.
   165         -	} 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 {
   166         -	    Format of the help to generate.
   167         -	    This field is fed by the options --by-category, --full, --list, and --short.
   168         -	} 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 {
   169         -		Activate full form of the help.
   170         -	    } 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 {
   171         -		Activate list form of the help.
   172         -	    } 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 {
   173         -		Activate short form of the help.
   174         -	    } 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 {
   175         -	    The line width to format the help for.
   176         -	    Defaults to the terminal width, or 80 when
   177         -	    no terminal is available.
   178         -	} 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.
          249  +	} 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}} {hammer exit} {desc {Exit the shell.
          250  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {ZZZ::my shell-exit}} help {desc {Retrieve help for a command or command set.
   179    251   	    Without arguments help for all commands is given.
   180    252   	    The default format is --full.} options {--by-category {
   181    253   		Activate by-category form of the help.
   182    254   	    } --full {
   183    255   		Activate full form of the help.
   184    256   	    } --list {
   185    257   		Activate list form of the help.
................................................................................
   204    276   		Activate list form of the help.
   205    277   	    } 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 {
   206    278   		Activate short form of the help.
   207    279   	    } 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 {
   208    280   	    The line width to format the help for.
   209    281   	    Defaults to the terminal width, or 80 when
   210    282   	    no terminal is available.
   211         -	} 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.
   212         -	    Without arguments help for all commands is given.
   213         -	    The default format is --full.} options {--by-category {
   214         -		Activate by-category form of the help.
   215         -	    } --full {
   216         -		Activate full form of the help.
   217         -	    } --list {
   218         -		Activate list form of the help.
   219         -	    } --short {
   220         -		Activate short form of the help.
   221         -	    } --width {
   222         -	    The line width to format the help for.
   223         -	    Defaults to the terminal width, or 80 when
   224         -	    no terminal is available.
   225         -	} -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 {
   226         -		Activate by-category form of the help.
   227         -	    } 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 {
   228         -	    The entire command line, the name of the
   229         -	    command to get help for. This can be several
   230         -	    words.
   231         -	} 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 {
   232         -	    Format of the help to generate.
   233         -	    This field is fed by the options --by-category, --full, --list, and --short.
   234         -	} 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 {
   235         -		Activate full form of the help.
   236         -	    } 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 {
   237         -		Activate list form of the help.
   238         -	    } 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 {
   239         -		Activate short form of the help.
   240         -	    } 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 {
   241         -	    The line width to format the help for.
   242         -	    Defaults to the terminal width, or 80 when
   243         -	    no terminal is available.
   244         -	} 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.
   245         -	    Without arguments help for all commands is given.
   246         -	    The default format is --full.} options {--by-category {
   247         -		Activate by-category form of the help.
   248         -	    } --full {
   249         -		Activate full form of the help.
   250         -	    } --list {
   251         -		Activate list form of the help.
   252         -	    } --short {
   253         -		Activate short form of the help.
   254         -	    } --width {
   255         -	    The line width to format the help for.
   256         -	    Defaults to the terminal width, or 80 when
   257         -	    no terminal is available.
   258         -	} -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 {
   259         -		Activate by-category form of the help.
   260         -	    } 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 {
   261         -	    The entire command line, the name of the
   262         -	    command to get help for. This can be several
   263         -	    words.
   264         -	} 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 {
   265         -	    Format of the help to generate.
   266         -	    This field is fed by the options --by-category, --full, --list, and --short.
   267         -	} 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 {
   268         -		Activate full form of the help.
   269         -	    } 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 {
   270         -		Activate list form of the help.
   271         -	    } 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 {
   272         -		Activate short form of the help.
   273         -	    } 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 {
   274         -	    The line width to format the help for.
   275         -	    Defaults to the terminal width, or 80 when
   276         -	    no terminal is available.
   277         -	} 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}}}
          283  +	} 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}} exit {desc {Exit the shell.
          284  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {ZZZ::my shell-exit}}}
   278    285   
   279    286   test cmdr-help-1.1 {help structure, inverted boolean option} -body {
   280    287       cmdr create x foo {
   281    288   	description TEST
   282    289   	private nail {
   283    290   	    description workbench
   284    291   	    option no-driver force { list ; alias force }
................................................................................
   316    323   		Activate list form of the help.
   317    324   	    } 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 {
   318    325   		Activate short form of the help.
   319    326   	    } 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 {
   320    327   	    The line width to format the help for.
   321    328   	    Defaults to the terminal width, or 80 when
   322    329   	    no terminal is available.
   323         -	} 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}}}
          330  +	} 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}} exit {desc {Exit the shell.
          331  +			No-op if not in a shell.} options {} opt2para {} arguments {} states {} parameters {} sections {} action {::oo::Obj972::my shell-exit}}}
   324    332   
   325    333   # # ## ### ##### ######## ############# #####################
   326    334   
   327    335   test cmdr-help-2.0 {full - formatting help structure} -body {
   328    336       HelpLarge full
   329    337   } -result {bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
   330    338       hawaii
................................................................................
   352    360                     terminal is available.
   353    361       -w            Alias of --width.
   354    362   
   355    363       cmdname The entire command line, the name of
   356    364               the command to get help for. This can
   357    365               be several words.
   358    366   
          367  +bar exit
          368  +    Exit the shell. No-op if not in a shell.
          369  +
   359    370   snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
   360    371       hawaii
   361    372   
   362    373       --lulu    loop
   363    374       --no-lulu Complementary alias of --lulu.
   364    375   
   365    376       yoyo height
................................................................................
   382    393                     terminal is available.
   383    394       -w            Alias of --width.
   384    395   
   385    396       cmdname The entire command line, the name of
   386    397               the command to get help for. This can
   387    398               be several words.
   388    399   
          400  +snafu exit
          401  +    Exit the shell. No-op if not in a shell.
          402  +
   389    403   tool pliers help [OPTIONS] [<cmdname>...]
   390    404       Retrieve help for a command or command set.
   391    405       Without arguments help for all commands is
   392    406       given. The default format is --full.
   393    407   
   394    408       --by-category Activate by-category form of the
   395    409                     help.
................................................................................
   402    416                     terminal is available.
   403    417       -w            Alias of --width.
   404    418   
   405    419       cmdname The entire command line, the name of
   406    420               the command to get help for. This can
   407    421               be several words.
   408    422   
          423  +tool pliers exit
          424  +    Exit the shell. No-op if not in a shell.
          425  +
   409    426   tool hammer nail [OPTIONS] [<supply>...]
   410    427       workbench
   411    428   
   412    429       --driver force
   413    430       --force  Alias of --driver.
   414    431   
   415    432       supply magazine
................................................................................
   430    447                     terminal is available.
   431    448       -w            Alias of --width.
   432    449   
   433    450       cmdname The entire command line, the name of
   434    451               the command to get help for. This can
   435    452               be several words.
   436    453   
          454  +tool hammer exit
          455  +    Exit the shell. No-op if not in a shell.
          456  +
   437    457   tool help [OPTIONS] [<cmdname>...]
   438    458       Retrieve help for a command or command set.
   439    459       Without arguments help for all commands is
   440    460       given. The default format is --full.
   441    461   
   442    462       --by-category Activate by-category form of the
   443    463                     help.
................................................................................
   450    470                     terminal is available.
   451    471       -w            Alias of --width.
   452    472   
   453    473       cmdname The entire command line, the name of
   454    474               the command to get help for. This can
   455    475               be several words.
   456    476   
          477  +tool exit
          478  +    Exit the shell. No-op if not in a shell.
          479  +
   457    480   hammer nail [OPTIONS] [<supply>...]
   458    481       workbench
   459    482   
   460    483       --driver force
   461    484       --force  Alias of --driver.
   462    485   
   463    486       supply magazine
................................................................................
   478    501                     terminal is available.
   479    502       -w            Alias of --width.
   480    503   
   481    504       cmdname The entire command line, the name of
   482    505               the command to get help for. This can
   483    506               be several words.
   484    507   
          508  +hammer exit
          509  +    Exit the shell. No-op if not in a shell.
          510  +
   485    511   help [OPTIONS] [<cmdname>...]
   486    512       Retrieve help for a command or command set.
   487    513       Without arguments help for all commands is
   488    514       given. The default format is --full.
   489    515   
   490    516       --by-category Activate by-category form of the
   491    517                     help.
................................................................................
   497    523                     terminal width, or 80 when no
   498    524                     terminal is available.
   499    525       -w            Alias of --width.
   500    526   
   501    527       cmdname The entire command line, the name of
   502    528               the command to get help for. This can
   503    529               be several words.
          530  +
          531  +exit
          532  +    Exit the shell. No-op if not in a shell.
   504    533   }
   505    534   
   506    535   test cmdr-help-2.1 {full formatting - help structure, inverted boolean option} -body {
   507    536       HelpSmall full
   508    537   } -result {nail [OPTIONS]
   509    538       workbench
   510    539   
................................................................................
   528    557                     terminal width, or 80 when no
   529    558                     terminal is available.
   530    559       -w            Alias of --width.
   531    560   
   532    561       cmdname The entire command line, the name of
   533    562               the command to get help for. This can
   534    563               be several words.
          564  +
          565  +exit
          566  +    Exit the shell. No-op if not in a shell.
   535    567   }
   536    568   
   537    569   # # ## ### ##### ######## ############# #####################
   538    570   
   539    571   test cmdr-help-3.0 {short - formatting help structure} -body {
   540    572       HelpLarge short
   541    573   } -result {bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
................................................................................
   542    574       hawaii
   543    575   
   544    576   bar help [OPTIONS] [<cmdname>...]
   545    577       Retrieve help for a command or command set.
   546    578       Without arguments help for all commands is
   547    579       given. The default format is --full.
   548    580   
          581  +bar exit
          582  +    Exit the shell. No-op if not in a shell.
          583  +
   549    584   snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
   550    585       hawaii
   551    586   
   552    587   snafu help [OPTIONS] [<cmdname>...]
   553    588       Retrieve help for a command or command set.
   554    589       Without arguments help for all commands is
   555    590       given. The default format is --full.
   556    591   
          592  +snafu exit
          593  +    Exit the shell. No-op if not in a shell.
          594  +
   557    595   tool pliers help [OPTIONS] [<cmdname>...]
   558    596       Retrieve help for a command or command set.
   559    597       Without arguments help for all commands is
   560    598       given. The default format is --full.
   561    599   
          600  +tool pliers exit
          601  +    Exit the shell. No-op if not in a shell.
          602  +
   562    603   tool hammer nail [OPTIONS] [<supply>...]
   563    604       workbench
   564    605   
   565    606   tool hammer help [OPTIONS] [<cmdname>...]
   566    607       Retrieve help for a command or command set.
   567    608       Without arguments help for all commands is
   568    609       given. The default format is --full.
   569    610   
          611  +tool hammer exit
          612  +    Exit the shell. No-op if not in a shell.
          613  +
   570    614   tool help [OPTIONS] [<cmdname>...]
   571    615       Retrieve help for a command or command set.
   572    616       Without arguments help for all commands is
   573    617       given. The default format is --full.
   574    618   
          619  +tool exit
          620  +    Exit the shell. No-op if not in a shell.
          621  +
   575    622   hammer nail [OPTIONS] [<supply>...]
   576    623       workbench
   577    624   
   578    625   hammer help [OPTIONS] [<cmdname>...]
   579    626       Retrieve help for a command or command set.
   580    627       Without arguments help for all commands is
   581    628       given. The default format is --full.
   582    629   
          630  +hammer exit
          631  +    Exit the shell. No-op if not in a shell.
          632  +
   583    633   help [OPTIONS] [<cmdname>...]
   584    634       Retrieve help for a command or command set.
   585    635       Without arguments help for all commands is
   586    636       given. The default format is --full.
          637  +
          638  +exit
          639  +    Exit the shell. No-op if not in a shell.
   587    640   }
   588    641   
   589    642   test cmdr-help-3.1 {short formatting - help structure, inverted boolean option} -body {
   590    643       HelpSmall short
   591    644   } -result {nail [OPTIONS]
   592    645       workbench
   593    646   
   594    647   help [OPTIONS] [<cmdname>...]
   595    648       Retrieve help for a command or command set.
   596    649       Without arguments help for all commands is
   597    650       given. The default format is --full.
          651  +
          652  +exit
          653  +    Exit the shell. No-op if not in a shell.
   598    654   }
   599    655   
   600    656   # # ## ### ##### ######## ############# #####################
   601    657   
   602    658   test cmdr-help-4.0 {list - formatting help structure} -body {
   603    659       HelpLarge list
   604    660   } -result {    bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
   605    661       bar help [OPTIONS] [<cmdname>...]
          662  +    bar exit
   606    663       snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
   607    664       snafu help [OPTIONS] [<cmdname>...]
          665  +    snafu exit
   608    666       tool pliers help [OPTIONS] [<cmdname>...]
          667  +    tool pliers exit
   609    668       tool hammer nail [OPTIONS] [<supply>...]
   610    669       tool hammer help [OPTIONS] [<cmdname>...]
          670  +    tool hammer exit
   611    671       tool help [OPTIONS] [<cmdname>...]
          672  +    tool exit
   612    673       hammer nail [OPTIONS] [<supply>...]
   613    674       hammer help [OPTIONS] [<cmdname>...]
   614         -    help [OPTIONS] [<cmdname>...]}
          675  +    hammer exit
          676  +    help [OPTIONS] [<cmdname>...]
          677  +    exit}
   615    678   
   616    679   test cmdr-help-4.1 {list formatting - help structure, inverted boolean option} -body {
   617    680       HelpSmall list
   618    681   } -result {    nail [OPTIONS]
   619         -    help [OPTIONS] [<cmdname>...]}
          682  +    help [OPTIONS] [<cmdname>...]
          683  +    exit}
   620    684   
   621    685   # # ## ### ##### ######## ############# #####################
   622    686   return

Changes to tests/main.tests.

    36     36       cmdr create OBJ NAME SPEC X
    37     37   } -returnCodes error \
    38     38       -result {wrong # args: should be "cmdr create obj name spec"}
    39     39   
    40     40   # # ## ### ##### ######## ############# #####################
    41     41   ## Basic officer, knows nothing. create/new with proper arguments.
    42     42   
    43         -test cmdr-main-2.0 {new, nothing but auto-help} -setup {
           43  +test cmdr-main-2.0 {new, nothing but auto-help and -exit} -setup {
    44     44       set x [cmdr new foo {}]
    45     45   } -body {
    46     46       list [$x known] [$x hasdefault]
    47     47   } -cleanup {
    48     48       $x destroy
    49     49       unset x
    50         -} -result {help 0}
           50  +} -result {{help exit} 0}
    51     51   
    52         -test cmdr-main-2.1 {create, nothing but auto-help} -setup {
           52  +test cmdr-main-2.1 {create, nothing but auto-help and -exit} -setup {
    53     53       cmdr create x foo {}
    54     54   } -body {
    55     55       list [x known] [x hasdefault]
    56     56   } -cleanup {
    57     57       x destroy
    58         -} -result {help 0}
           58  +} -result {{help exit} 0}
    59     59   
    60     60   # # ## ### ##### ######## ############# #####################
    61     61   return

Changes to tests/officer.tests.

    22     22       x destroy
    23     23   } -result {
    24     24       foo = {
    25     25           description: 'TEST'
    26     26           default: bar
    27     27           store (K): 'D'
    28     28           bar --> bar
           29  +        exit --> exit
    29     30           help --> help
    30     31           pliers --> pliers
    31     32           snafu --> bar
    32     33           tool --> tool
    33     34       }
    34     35       foo bar = {
    35     36           description: ''
    36     37           no default
    37     38           store (K): 'D'
           39  +        exit --> exit
    38     40           help --> help
    39     41       }
    40     42       foo tool = {
    41     43           description: ''
    42     44           default: pliers
    43     45           store (K): 'D'
    44     46           store (U): 'V'
           47  +        exit --> exit
    45     48           hammer --> hammer
    46     49           help --> help
    47     50           pliers --> pliers
    48     51       }
    49     52       foo tool hammer = {
    50     53           description: ''
    51     54           no default
    52     55           store (K): 'D'
    53     56           store (U): 'V'
           57  +        exit --> exit
    54     58           help --> help
    55     59       }
    56     60       foo tool pliers = {
    57     61           description: ''
    58     62           no default
    59     63           store (K): 'D'
    60     64           store (U): 'V'
           65  +        exit --> exit
    61     66           help --> help
    62     67       }
    63     68   }
    64     69   
    65     70   # # ## ### ##### ######## ############# #####################
    66     71   ## Error cases of the action DSL.
    67     72