Index: tcc4tcl.tcl ================================================================== --- tcc4tcl.tcl +++ tcc4tcl.tcl @@ -163,12 +163,12 @@ # XXX:TODO: This needs to handle shell-quoted arguments upvar #0 $handle state set cmdStr [regsub -all { *} $cmdStr { }] set work [split $cmdStr " "] - foreach arg $work { - switch -glob -- $arg { + foreach cmd $work { + switch -glob -- $cmd { "-I*" { set dir [string range $cmd 2 end] _add_include_path $handle $dir } "-D*" { Index: test.tcl ================================================================== --- test.tcl +++ test.tcl @@ -61,10 +61,19 @@ if {$err != "" || $v == 1} { error "\[test4\] did not return the expected error" } # New API +## Test processing the commandline +set handle [tcc4tcl::new] +$handle process_command_line -Dx=1234 +$handle cproc test13 {int i} int { + return(i+x); +} +$handle go +puts "[test13 1] = 1235" + ## Simple test set handle [tcc4tcl::new] $handle cproc test5 {int i} int { return(i + 42); } if {[$handle code] == ""} { error "[list $handle code] did not give code output"