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

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

Overview
Comment:Tweaked output for help --full, added option arguments for options requiring them.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 84658915a64e05cad7ee1b2ef07e05ade380d370
User & Date: aku 2014-08-29 05:07:50
Context
2014-08-29
20:19
cmdr::parameter - Extended spec with description of option argument, if any. cmdr::help - Modified to make use of the new information in help texts. check-in: 463519edc6 user: andreask tags: trunk
05:07
Tweaked output for help --full, added option arguments for options requiring them. check-in: 84658915a6 user: aku tags: trunk
2014-08-27
23:41
Bump versions of cmdr::color and cmdr::ask to 1. Fixed a prompt issue in cmdr::ask::string*. Extended debug narrative regarding prompt handling. check-in: 9d0fa722e9 user: andreask tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to help.tcl.

   232    232       }
   233    233   
   234    234       # plus per-option descriptions (sort by flag name)
   235    235       if {[dict size $options]} {
   236    236   	set onames {}
   237    237   	set odefs  {}
   238    238   	foreach {oname ohelp} [::cmdr util dictsort $options] {
          239  +	    # Inspect the parameter and determine of the option
          240  +	    # requires an argument. If yes, suitably extend the
          241  +	    # definition key of the option list.
          242  +	    set pname [dict get $opt2para $oname]
          243  +	    set vt    [dict get $parameters $pname validator]
          244  +	    if {$vt ne "::cmdr::validate::boolean"} {
          245  +		# FUTURE: Make the argument label specifiable.
          246  +		set plabel [dict get $parameters $pname label]
          247  +		append oname " [string toupper $plabel]"
          248  +	    }
          249  +
   239    250   	    lappend onames $oname
   240    251   	    lappend odefs  $ohelp
   241    252   	}
   242    253   	DefList $width $onames $odefs
   243    254       }
   244    255   
   245    256       # plus per-argument descriptions (keep in cmdline order)