cmdr
Check-in [2bfa8d5785]
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:Move handling of global option to before checking for a command. We can now enter a main shell with global options set. Bump version numbers.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2bfa8d578585c4f9bbf875b29dab303f54c8b9fd
User & Date: andreask 2014-09-10 20:35:04
Context
2014-09-19
17:52
cmdr::parameter - Utility DSL commands for easy locking (disallow) and trivial accss to siblings (touch, touch?). Semantic change for when-* hooks. Now storing a list and multiple when-set definitions accumulate. Tweaking locking error message to use better name of the locked parameter. check-in: 9fc3922163 user: andreask tags: trunk
2014-09-10
20:35
Move handling of global option to before checking for a command. We can now enter a main shell with global options set. Bump version numbers. check-in: 2bfa8d5785 user: andreask tags: trunk
20:21
Moved handling of option arguments in help to separate proc. Reworked the handling of global options to show arguments as well. Fixed sorting of section display when seeing options with arguments. check-in: f41f44de14 user: andreask tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to help.tcl.

   603    603       }
   604    604   
   605    605       return $categories
   606    606   }
   607    607   
   608    608   # # ## ### ##### ######## ############# #####################
   609    609   ## Ready
   610         -package provide cmdr::help 1.3
          610  +package provide cmdr::help 1.3.1

Changes to officer.tcl.

   408    408       # # ## ### ##### ######## #############
   409    409       ## Command dispatcher. Choose the subordinate and delegate.
   410    410   
   411    411       method do {args} {
   412    412   	debug.cmdr/officer {}
   413    413   	my Setup
   414    414   
          415  +	# Process any options we may find. The first non-option
          416  +	# will be the command to dispatch on.
          417  +	set args [config parse-head-options {*}$args]
          418  +
   415    419   	# No command specified, what should we do ?
   416    420   	# (1) If there is a default, we can go on (Do will call on it).
   417    421   	# (2) Without default we must enter an interactive shell.
   418    422   	# (3) Except if interaction is globally suppressed. Then we
   419    423   	#     fall through, again, to generate the proper error message.
   420    424   	#
   421    425   	# Result: Interact with the user if no command was specified,
................................................................................
   453    457   	set reset 0
   454    458   	if {![my exists *command*]} {
   455    459   	    # Prevent handling of application-specific options here.
   456    460   	    my set *command* -- $args
   457    461   	    set reset 1
   458    462   	}
   459    463   	try {
   460         -	    # Process any options we may find. The first non-option
   461         -	    # will be the command to dispatch on.
   462         -	    set args [config parse-head-options {*}$args]
   463         -
   464    464   	    # Empty command. Delegate to the default, if we have any.
   465    465   	    # Otherwise fail.
   466    466   	    if {![llength $args]} {
   467    467   		if {[my hasdefault]} {
   468    468   		    return [[my lookup [my default]] do]
   469    469   		}
   470    470   		return -code error -errorcode {CMDR DO EMPTY} \
................................................................................
   751    751   	myreplexit myhandler mypmap myshandler myconfig
   752    752   
   753    753       # # ## ### ##### ######## #############
   754    754   }
   755    755   
   756    756   # # ## ### ##### ######## ############# #####################
   757    757   ## Ready
   758         -package provide cmdr::officer 1.4
          758  +package provide cmdr::officer 1.4.1