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 Unified Diffs Ignore Whitespace Patch

Changes to actor.tcl.

169
170
171
172
173
174
175





176

177
178
179
180
181
182
183
184
185
186
    method set {key args} {
	debug.cmdr/actor {}
	set extend 0
	while {[string match -* [lindex $args 0]]} {
	    set args [lassign $args o]
	    switch -exact -- $o {





		-extend {set extend 1}

		default {
		    return -code error -errorcode {CMDR SET UNKNOWN OPTION} \
			"Unknown option \"$o\", expected -extend"
		}
	    }
	}
	if {[llength $args] != 1} {
	    # The method of getting the command name is so complicated
	    # to account for calls from specifications, where this is
	    # aliased as 'common'.






>
>
>
>
>
|
>


|







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

Changes to officer.tcl.

428
429
430
431
432
433
434

435
436
437
438
439
440
441
442
    }

    # Internal. Actual dispatch. Shared by main entry and shell.
    method Do {args} {
	debug.cmdr/officer {}
	set reset 0
	if {![my exists *command*]} {

	    my set *command* $args
	    set reset 1
	}
	try {
	    # Empty command. Delegate to the default, if we have any.
	    # Otherwise fail.
	    if {![llength $args]} {
		if {[my hasdefault]} {






>
|







428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
    }

    # Internal. Actual dispatch. Shared by main entry and shell.
    method Do {args} {
	debug.cmdr/officer {}
	set reset 0
	if {![my exists *command*]} {
	    # Prevent handling of application-specific options here.
	    my set *command* -- $args
	    set reset 1
	}
	try {
	    # Empty command. Delegate to the default, if we have any.
	    # Otherwise fail.
	    if {![llength $args]} {
		if {[my hasdefault]} {