cmdr
Check-in [cd7539eb28]
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:cmdr::actor, cmdr::officer - Fix bug introduced with revision [7ab77ead21]. The option handling added to "actor::set" in that revision means that the command "my set *command* ..." storing the actual command line (i.e. user information) can break, trying to interpret application specific option information as something for the internal command. Fixed by adding "--" to "actor::set"s option handling, and using it for the breakable command to force interpretation of the user data as such.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cd7539eb285acac3981db83f893c9dac0c1b76a4
User & Date: andreask 2014-05-28 23:33:07
Context
2014-06-03
00:16
cmdr::help - Extended the backend to invoke a pager if the help is too high for the terminal. Lots of things (not terminal, no support in linenoise, no pager) will disable this. Bumped version to 1.3. check-in: e15928b830 user: andreask tags: trunk
2014-05-28
23:33
cmdr::actor, cmdr::officer - Fix bug introduced with revision [7ab77ead21]. The option handling added to "actor::set" in that revision means that the command "my set *command* ..." storing the actual command line (i.e. user information) can break, trying to interpret application specific option information as something for the internal command. Fixed by adding "--" to "actor::set"s option handling, and using it for the breakable command to force interpretation of the user data as such. check-in: cd7539eb28 user: andreask tags: trunk
2014-05-26
17:19
cmdr::color - Need -prefixes 0 to avoid name/names clash. check-in: 27ba981e40 user: aku tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to actor.tcl.

   169    169   
   170    170       method set {key args} {
   171    171   	debug.cmdr/actor {}
   172    172   	set extend 0
   173    173   	while {[string match -* [lindex $args 0]]} {
   174    174   	    set args [lassign $args o]
   175    175   	    switch -exact -- $o {
   176         -		-extend {set extend 1}
          176  +		-- {
          177  +		    # Stop option processing. Next argument must be the data.
          178  +		    break
          179  +		}
          180  +		-extend {
          181  +		    set extend 1
          182  +		}
   177    183   		default {
   178    184   		    return -code error -errorcode {CMDR SET UNKNOWN OPTION} \
   179         -			"Unknown option \"$o\", expected -extend"
          185  +			"Unknown option \"$o\", expected -extend, or --"
   180    186   		}
   181    187   	    }
   182    188   	}
   183    189   	if {[llength $args] != 1} {
   184    190   	    # The method of getting the command name is so complicated
   185    191   	    # to account for calls from specifications, where this is
   186    192   	    # aliased as 'common'.

Changes to officer.tcl.

   428    428       }
   429    429   
   430    430       # Internal. Actual dispatch. Shared by main entry and shell.
   431    431       method Do {args} {
   432    432   	debug.cmdr/officer {}
   433    433   	set reset 0
   434    434   	if {![my exists *command*]} {
   435         -	    my set *command* $args
          435  +	    # Prevent handling of application-specific options here.
          436  +	    my set *command* -- $args
   436    437   	    set reset 1
   437    438   	}
   438    439   	try {
   439    440   	    # Empty command. Delegate to the default, if we have any.
   440    441   	    # Otherwise fail.
   441    442   	    if {![llength $args]} {
   442    443   		if {[my hasdefault]} {