cmdr
Check-in [9a37e9fade]
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:Bumped version number of the changed packages. Started on help. First, excluded imported parameters from help.
Timelines: family | ancestors | descendants | both | global-options
Files: files | file ages | folders
SHA1: 9a37e9fadeaae2f1164c04ee84029d17da6f56c3
User & Date: andreask 2014-08-26 00:11:34
Context
2014-08-26
19:45
Updated help generation to show global options in categorized help. General update to handle officers now appearing in the help structures. Bumped version numbers. All parts done. Notes removed. Closed-Leaf check-in: f853a46223 user: andreask tags: global-options
00:11
Bumped version number of the changed packages. Started on help. First, excluded imported parameters from help. check-in: 9a37e9fade user: andreask tags: global-options
2014-08-25
23:08
Merge fixes from trunk. check-in: 7d15626394 user: andreask tags: global-options
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to NOTES.

    12     12   
    13     13   **	This is done by importing them into the cmdr::config of the
    14     14   	sub-ordinate at the time it is processing its own specification.
    15     15   
    16     16   **	This means that sub-ordinates _cannot_ specify their own
    17     17   	options with the same name.
    18     18   
    19         -TODO	An exception is the generation of help, where the options of
           19  +**	An exception is the generation of help, where the options of
    20     20   	the officer are only seen by the officer itself, and none of
    21     21   	the sub-ordinates. This will unclutter the individual commands
    22     22   	which otherwise would show all the .use'd options.
    23     23   
    24     24   **	The import also means that the backend code can access these
    25     25   	option parameters directly, without having to walk up in the
    26     26   	command tree. There is no need to extend officers with
................................................................................
    33     33   		options automatically spread down the entire tree.
    34     34   
    35     35   **	(b)	Cmdline processing in officers is extended to check
    36     36   		for options and handle them if known, or throw an
    37     37   		error if not.
    38     38   
    39     39   (3) Help
    40         -TODO	(a)	Imported parameters of an officer or private are
           40  +**	(a)	Imported parameters of an officer or private are
    41     41   		excluded from the generated help.
    42     42   
    43     43   TODO	(b)	The help structure is extended so that officers can
    44     44   		declare the options they understand.

Changes to config.tcl.

   188    188   	#
   189    189   	# Option aliases are listed in options, but not in parameters.
   190    190   
   191    191   	set options {}
   192    192   	set optpara {}
   193    193   
   194    194   	dict for {o para} $myoption {
          195  +
          196  +	    # Ignore options imported from the parent.
          197  +	    # These are documented where defined.
          198  +	    if {[$para config] ne [self]} continue
          199  +
   195    200   	    # in interactive mode undocumented options can be shown in
   196    201   	    # the help if they already have a value defined for them.
   197    202   	    if {![$para documented] &&
   198    203   		(($mode ne "interact") ||
   199    204   		 ![$para set?])} continue
   200    205   
   201    206   	    # in interactive mode we skip all the aliases.
................................................................................
   217    222   	# not just bits and pieces.
   218    223   
   219    224   	set states     {}
   220    225   	set parameters {}
   221    226   
   222    227   	foreach p [lsort -dict $mynames] {
   223    228   	    set para [dict get $mymap $p]
          229  +
          230  +	    # Ignore all parameters imported from the parent.
          231  +	    # These are documented where defined.
          232  +	    if {[$para config] ne [self]} continue
          233  +
   224    234   	    dict set parameters $p [$para help]
   225    235   
   226    236   	    if {![$para is state]} continue
   227    237   	    lappend states $p
   228    238   	}
   229    239   
   230    240   	return [dict create \
................................................................................
  1473   1483       }
  1474   1484   
  1475   1485       # # ## ### ##### ######## #############
  1476   1486   }
  1477   1487   
  1478   1488   # # ## ### ##### ######## ############# #####################
  1479   1489   ## Ready
  1480         -package provide cmdr::config 1.1.1
         1490  +package provide cmdr::config 1.2

Changes to officer.tcl.

   747    747   	myreplexit myhandler mypmap myshandler myconfig
   748    748   
   749    749       # # ## ### ##### ######## #############
   750    750   }
   751    751   
   752    752   # # ## ### ##### ######## ############# #####################
   753    753   ## Ready
   754         -package provide cmdr::officer 1.3
          754  +package provide cmdr::officer 1.4

Changes to private.tcl.

   210    210       variable myarguments mycmd myinit myconfig myhandler
   211    211   
   212    212       # # ## ### ##### ######## #############
   213    213   }
   214    214   
   215    215   # # ## ### ##### ######## ############# #####################
   216    216   ## Ready
   217         -package provide cmdr::private 1.2
          217  +package provide cmdr::private 1.3