Corrected an issue with passing a Tcl script as a command-line
argument. For interactive magic in the Tcl/Tk wrapper, the "-nowindow" option was appended to the command line. But for Tcl scripts on the command line, all arguments following the script name are considered arguments of the script. So the "-nowindow" argument has to be inserted at the beginning of the command line as the first argument after "magic".
This commit is contained in:
parent
60049f3702
commit
82d64aa4b1
|
|
@ -226,7 +226,10 @@ for {set i 0} {$i < $argc} {incr i 1} {
|
||||||
|
|
||||||
if {$do_wrapper} {
|
if {$do_wrapper} {
|
||||||
source ${CAD_ROOT}/magic/tcl/wrapper.tcl
|
source ${CAD_ROOT}/magic/tcl/wrapper.tcl
|
||||||
lappend argafter "-nowindow" ;# Set no-initial-window option in magic.
|
# Set the no-initial-window option in magic. Do *not* append it, as the
|
||||||
|
# arguments may have a Tcl script, for which all following arguments are
|
||||||
|
# considered arguments of the script.
|
||||||
|
set argafter [linsert $argafter 1 -nowindow]
|
||||||
}
|
}
|
||||||
unset x i do_wrapper
|
unset x i do_wrapper
|
||||||
if {[catch {eval $argafter}]} { ;# magic::initialize ${argv}
|
if {[catch {eval $argafter}]} { ;# magic::initialize ${argv}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue