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

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

Overview
Comment:Testsuite fixes, help output. Not fully fixed, only mostly.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6e5381c43cb6092c3f2ffd706f2d84e844f31af1
User & Date: aku 2015-05-08 21:04:42
Context
2015-05-08
22:37
Complete the fixes to help testsuite. check-in: adefffc9e0 user: andreask tags: trunk
21:04
Testsuite fixes, help output. Not fully fixed, only mostly. check-in: 6e5381c43c user: aku tags: trunk
20:27
Fixed color testing. Plus tweaked color command to always validate codes, even when use is disabled. check-in: 1a8a4b4d23 user: aku tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tests/help.tests.

   298    298   	    Without arguments help for all commands is given.
   299    299   	    The default format is --full.} options {--by-category {
   300    300   		Activate by-category form of the help.
   301    301   	    } --full {
   302    302   		Activate full form of the help.
   303    303   	    } --list {
   304    304   		Activate list form of the help.
          305  +	    } --no-pager {
          306  +	        Disable use of paging.
   305    307   	    } --short {
   306    308   		Activate short form of the help.
   307    309   	    } --width {
   308    310   	    The line width to format the help for.
   309    311   	    Defaults to the terminal width, or 80 when
   310    312   	    no terminal is available.
   311    313   	} -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 {
................................................................................
   349    351       Without arguments help for all commands is
   350    352       given. The default format is --full.
   351    353   
   352    354       --by-category Activate by-category form of the
   353    355                     help.
   354    356       --full        Activate full form of the help.
   355    357       --list        Activate list form of the help.
          358  +    --no-pager    Disable use of paging.
   356    359       --short       Activate short form of the help.
   357         -    --width       The line width to format the
          360  +    --width WIDTH The line width to format the
   358    361                     help for. Defaults to the
   359    362                     terminal width, or 80 when no
   360    363                     terminal is available.
   361         -    -w            Alias of --width.
          364  +    -w WIDTH      Alias of --width.
   362    365   
   363    366       cmdname The entire command line, the name of
   364    367               the command to get help for. This can
   365    368               be several words.
   366    369   
   367    370   bar exit
   368    371       Exit the shell. No-op if not in a shell.
          372  +
          373  +bar
   369    374   
   370    375   snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
   371    376       hawaii
   372    377   
   373    378       --lulu    loop
   374    379       --no-lulu Complementary alias of --lulu.
   375    380   
................................................................................
   382    387       Without arguments help for all commands is
   383    388       given. The default format is --full.
   384    389   
   385    390       --by-category Activate by-category form of the
   386    391                     help.
   387    392       --full        Activate full form of the help.
   388    393       --list        Activate list form of the help.
          394  +    --no-pager    Disable use of paging.
   389    395       --short       Activate short form of the help.
   390         -    --width       The line width to format the
          396  +    --width WIDTH The line width to format the
   391    397                     help for. Defaults to the
   392    398                     terminal width, or 80 when no
   393    399                     terminal is available.
   394         -    -w            Alias of --width.
          400  +    -w WIDTH      Alias of --width.
   395    401   
   396    402       cmdname The entire command line, the name of
   397    403               the command to get help for. This can
   398    404               be several words.
   399    405   
   400    406   snafu exit
   401    407       Exit the shell. No-op if not in a shell.
          408  +
          409  +snafu
   402    410   
   403    411   tool pliers help [OPTIONS] [<cmdname>...]
   404    412       Retrieve help for a command or command set.
   405    413       Without arguments help for all commands is
   406    414       given. The default format is --full.
   407    415   
   408    416       --by-category Activate by-category form of the
   409    417                     help.
   410    418       --full        Activate full form of the help.
   411    419       --list        Activate list form of the help.
          420  +    --no-pager    Disable use of paging.
   412    421       --short       Activate short form of the help.
   413         -    --width       The line width to format the
          422  +    --width WIDTH The line width to format the
   414    423                     help for. Defaults to the
   415    424                     terminal width, or 80 when no
   416    425                     terminal is available.
   417         -    -w            Alias of --width.
          426  +    -w WIDTH      Alias of --width.
   418    427   
   419    428       cmdname The entire command line, the name of
   420    429               the command to get help for. This can
   421    430               be several words.
   422    431   
   423    432   tool pliers exit
   424    433       Exit the shell. No-op if not in a shell.
          434  +
          435  +tool pliers
   425    436   
   426    437   tool hammer nail [OPTIONS] [<supply>...]
   427    438       workbench
   428    439   
   429         -    --driver force
   430         -    --force  Alias of --driver.
          440  +    --driver DRIVER force
          441  +    --force DRIVER  Alias of --driver.
   431    442   
   432    443       supply magazine
   433    444   
   434    445   tool hammer help [OPTIONS] [<cmdname>...]
   435    446       Retrieve help for a command or command set.
   436    447       Without arguments help for all commands is
   437    448       given. The default format is --full.
   438    449   
   439    450       --by-category Activate by-category form of the
   440    451                     help.
   441    452       --full        Activate full form of the help.
   442    453       --list        Activate list form of the help.
          454  +    --no-pager    Disable use of paging.
   443    455       --short       Activate short form of the help.
   444         -    --width       The line width to format the
          456  +    --width WIDTH The line width to format the
   445    457                     help for. Defaults to the
   446    458                     terminal width, or 80 when no
   447    459                     terminal is available.
   448         -    -w            Alias of --width.
          460  +    -w WIDTH      Alias of --width.
   449    461   
   450    462       cmdname The entire command line, the name of
   451    463               the command to get help for. This can
   452    464               be several words.
   453    465   
   454    466   tool hammer exit
   455    467       Exit the shell. No-op if not in a shell.
          468  +
          469  +tool hammer
   456    470   
   457    471   tool help [OPTIONS] [<cmdname>...]
   458    472       Retrieve help for a command or command set.
   459    473       Without arguments help for all commands is
   460    474       given. The default format is --full.
   461    475   
   462    476       --by-category Activate by-category form of the
   463    477                     help.
   464    478       --full        Activate full form of the help.
   465    479       --list        Activate list form of the help.
          480  +    --no-pager    Disable use of paging.
   466    481       --short       Activate short form of the help.
   467         -    --width       The line width to format the
          482  +    --width WIDTH The line width to format the
   468    483                     help for. Defaults to the
   469    484                     terminal width, or 80 when no
   470    485                     terminal is available.
   471         -    -w            Alias of --width.
          486  +    -w WIDTH      Alias of --width.
   472    487   
   473    488       cmdname The entire command line, the name of
   474    489               the command to get help for. This can
   475    490               be several words.
   476    491   
   477    492   tool exit
   478    493       Exit the shell. No-op if not in a shell.
          494  +
          495  +tool
   479    496   
   480    497   hammer nail [OPTIONS] [<supply>...]
   481    498       workbench
   482    499   
   483         -    --driver force
   484         -    --force  Alias of --driver.
          500  +    --driver DRIVER force
          501  +    --force DRIVER  Alias of --driver.
   485    502   
   486    503       supply magazine
   487    504   
   488    505   hammer help [OPTIONS] [<cmdname>...]
   489    506       Retrieve help for a command or command set.
   490    507       Without arguments help for all commands is
   491    508       given. The default format is --full.
   492    509   
   493    510       --by-category Activate by-category form of the
   494    511                     help.
   495    512       --full        Activate full form of the help.
   496    513       --list        Activate list form of the help.
          514  +    --no-pager    Disable use of paging.
   497    515       --short       Activate short form of the help.
   498         -    --width       The line width to format the
          516  +    --width WIDTH The line width to format the
   499    517                     help for. Defaults to the
   500    518                     terminal width, or 80 when no
   501    519                     terminal is available.
   502         -    -w            Alias of --width.
          520  +    -w WIDTH      Alias of --width.
   503    521   
   504    522       cmdname The entire command line, the name of
   505    523               the command to get help for. This can
   506    524               be several words.
   507    525   
   508    526   hammer exit
   509    527       Exit the shell. No-op if not in a shell.
          528  +
          529  +hammer
   510    530   
   511    531   help [OPTIONS] [<cmdname>...]
   512    532       Retrieve help for a command or command set.
   513    533       Without arguments help for all commands is
   514    534       given. The default format is --full.
   515    535   
   516    536       --by-category Activate by-category form of the
   517    537                     help.
   518    538       --full        Activate full form of the help.
   519    539       --list        Activate list form of the help.
          540  +    --no-pager    Disable use of paging.
   520    541       --short       Activate short form of the help.
   521         -    --width       The line width to format the
          542  +    --width WIDTH The line width to format the
   522    543                     help for. Defaults to the
   523    544                     terminal width, or 80 when no
   524    545                     terminal is available.
   525         -    -w            Alias of --width.
          546  +    -w WIDTH      Alias of --width.
   526    547   
   527    548       cmdname The entire command line, the name of
   528    549               the command to get help for. This can
   529    550               be several words.
   530    551   
   531    552   exit
   532    553       Exit the shell. No-op if not in a shell.
   533         -}
          554  +
          555  +
          556  +    TEST}
   534    557   
   535    558   test cmdr-help-2.1 {full formatting - help structure, inverted boolean option} -body {
   536    559       HelpSmall full
   537    560   } -result {nail [OPTIONS]
   538    561       workbench
   539    562   
   540    563       --driver    Complementary alias of
................................................................................
   547    570       Without arguments help for all commands is
   548    571       given. The default format is --full.
   549    572   
   550    573       --by-category Activate by-category form of the
   551    574                     help.
   552    575       --full        Activate full form of the help.
   553    576       --list        Activate list form of the help.
          577  +    --no-pager    Disable use of paging.
   554    578       --short       Activate short form of the help.
   555         -    --width       The line width to format the
          579  +    --width WIDTH The line width to format the
   556    580                     help for. Defaults to the
   557    581                     terminal width, or 80 when no
   558    582                     terminal is available.
   559         -    -w            Alias of --width.
          583  +    -w WIDTH      Alias of --width.
   560    584   
   561    585       cmdname The entire command line, the name of
   562    586               the command to get help for. This can
   563    587               be several words.
   564    588   
   565    589   exit
   566    590       Exit the shell. No-op if not in a shell.
   567         -}
          591  +
          592  +
          593  +    TEST}
   568    594   
   569    595   # # ## ### ##### ######## ############# #####################
   570    596   
   571    597   test cmdr-help-3.0 {short - formatting help structure} -body {
   572    598       HelpLarge short
   573    599   } -result {bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
   574    600       hawaii
................................................................................
   576    602   bar help [OPTIONS] [<cmdname>...]
   577    603       Retrieve help for a command or command set.
   578    604       Without arguments help for all commands is
   579    605       given. The default format is --full.
   580    606   
   581    607   bar exit
   582    608       Exit the shell. No-op if not in a shell.
          609  +
          610  +bar
   583    611   
   584    612   snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
   585    613       hawaii
   586    614   
   587    615   snafu help [OPTIONS] [<cmdname>...]
   588    616       Retrieve help for a command or command set.
   589    617       Without arguments help for all commands is
   590    618       given. The default format is --full.
   591    619   
   592    620   snafu exit
   593    621       Exit the shell. No-op if not in a shell.
          622  +
          623  +snafu
   594    624   
   595    625   tool pliers help [OPTIONS] [<cmdname>...]
   596    626       Retrieve help for a command or command set.
   597    627       Without arguments help for all commands is
   598    628       given. The default format is --full.
   599    629   
   600    630   tool pliers exit
   601    631       Exit the shell. No-op if not in a shell.
          632  +
          633  +tool pliers
   602    634   
   603    635   tool hammer nail [OPTIONS] [<supply>...]
   604    636       workbench
   605    637   
   606    638   tool hammer help [OPTIONS] [<cmdname>...]
   607    639       Retrieve help for a command or command set.
   608    640       Without arguments help for all commands is
   609    641       given. The default format is --full.
   610    642   
   611    643   tool hammer exit
   612    644       Exit the shell. No-op if not in a shell.
          645  +
          646  +tool hammer
   613    647   
   614    648   tool help [OPTIONS] [<cmdname>...]
   615    649       Retrieve help for a command or command set.
   616    650       Without arguments help for all commands is
   617    651       given. The default format is --full.
   618    652   
   619    653   tool exit
   620    654       Exit the shell. No-op if not in a shell.
          655  +
          656  +tool
   621    657   
   622    658   hammer nail [OPTIONS] [<supply>...]
   623    659       workbench
   624    660   
   625    661   hammer help [OPTIONS] [<cmdname>...]
   626    662       Retrieve help for a command or command set.
   627    663       Without arguments help for all commands is
   628    664       given. The default format is --full.
   629    665   
   630    666   hammer exit
   631    667       Exit the shell. No-op if not in a shell.
          668  +
          669  +hammer
   632    670   
   633    671   help [OPTIONS] [<cmdname>...]
   634    672       Retrieve help for a command or command set.
   635    673       Without arguments help for all commands is
   636    674       given. The default format is --full.
   637    675   
   638    676   exit
   639    677       Exit the shell. No-op if not in a shell.
   640         -}
          678  +
          679  +
          680  +    TEST}
   641    681   
   642    682   test cmdr-help-3.1 {short formatting - help structure, inverted boolean option} -body {
   643    683       HelpSmall short
   644    684   } -result {nail [OPTIONS]
   645    685       workbench
   646    686   
   647    687   help [OPTIONS] [<cmdname>...]
   648    688       Retrieve help for a command or command set.
   649    689       Without arguments help for all commands is
   650    690       given. The default format is --full.
   651    691   
   652    692   exit
   653    693       Exit the shell. No-op if not in a shell.
   654         -}
          694  +
          695  +
          696  +    TEST}
   655    697   
   656    698   # # ## ### ##### ######## ############# #####################
   657    699   
   658    700   test cmdr-help-4.0 {list - formatting help structure} -body {
   659    701       HelpLarge list
   660    702   } -result {    bar aloha [OPTIONS] <yoyo> [<jump>] <run>...
   661    703       bar help [OPTIONS] [<cmdname>...]
   662    704       bar exit
          705  +    bar
   663    706       snafu aloha [OPTIONS] <yoyo> [<jump>] <run>...
   664    707       snafu help [OPTIONS] [<cmdname>...]
   665    708       snafu exit
          709  +    snafu
   666    710       tool pliers help [OPTIONS] [<cmdname>...]
   667    711       tool pliers exit
          712  +    tool pliers
   668    713       tool hammer nail [OPTIONS] [<supply>...]
   669    714       tool hammer help [OPTIONS] [<cmdname>...]
   670    715       tool hammer exit
          716  +    tool hammer
   671    717       tool help [OPTIONS] [<cmdname>...]
   672    718       tool exit
          719  +    tool
   673    720       hammer nail [OPTIONS] [<supply>...]
   674    721       hammer help [OPTIONS] [<cmdname>...]
   675    722       hammer exit
          723  +    hammer
   676    724       help [OPTIONS] [<cmdname>...]
   677    725       exit}
   678    726   
   679    727   test cmdr-help-4.1 {list formatting - help structure, inverted boolean option} -body {
   680    728       HelpSmall list
   681    729   } -result {    nail [OPTIONS]
   682    730       help [OPTIONS] [<cmdname>...]
   683    731       exit}
   684    732   
   685    733   # # ## ### ##### ######## ############# #####################
   686    734   return

Changes to tests/support.tcl.

    62     62   	} ::wall
    63     63       } $format $n
    64     64   }
    65     65   
    66     66   proc Help {def format n} {
    67     67       try {
    68     68   	cmdr create x foo $def
    69         -	cmdr help format $format x $n [x help]
           69  +	string trimright [cmdr help format $format x $n [x help]] \n
    70     70       } finally {
    71     71   	x destroy
    72     72       }
    73     73   }
    74     74   
    75     75   # # ## ### ##### ######## ############# #####################
    76     76   ## Supporting procedures for cmdr.test et. al.