From: John L. <jr...@us...> - 2006-12-07 22:05:59
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11065/wxLua/docs Modified Files: wxlua.html Log Message: cleanup arg processing for wxLua program to match the lua program Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wxlua.html 17 Nov 2006 20:54:02 -0000 1.8 --- wxlua.html 7 Dec 2006 22:05:53 -0000 1.9 *************** *** 1130,1141 **** start the debuggee process by hand by running another wxLua process as "wxLua -dHOSTNAME:PORT program.lua" using the appropriate values for ! HOSTNAME:PORT as shown in the status window after selecting <i>Attach</i>. You can abort the debugging by selecting <i>Reset</i>.</li> ! <li><i>Start Debug</i> - Start debugging the current program where you can then <i>Step, Step Over, Continue, Break</i>.</li> ! <li><i>Reset</i> - Stop debugging and close the debuggee process.</li> --- 1130,1143 ---- start the debuggee process by hand by running another wxLua process as "wxLua -dHOSTNAME:PORT program.lua" using the appropriate values for ! HOSTNAME:PORT as shown in the wxLua status window after selecting <i>Attach</i>. You can abort the debugging by selecting <i>Reset</i>.</li> ! <li><i>Start Debugging</i> - Start debugging ! the current program where you can then <i>Step, Step Over, Continue, Break</i>.</li> ! <li><i>Stop Debugging</i> - Stop debugging and ! close the debuggee process.</li> *************** *** 1150,1153 **** --- 1152,1226 ---- </ul> + <li>This program can also run lua or wxLua programs on the + command line just like the lua executable.</li> + + <ul> + + <li>The command line switches can be displayed by running + wxLua -h.</li> + + <li>The editor is run if no parameters are given.</li> + + <li>Note that the switches -c, -q, -e must be specified + before -d, -o, -r</li> + + <li>The switches -d (run as debuggee), -o (open files to + edit), and -r (run file) are exclusive and you can only use one.</li> + + <li>If -d, -o, or -r are not given but there is at + least one parameter on the command line, it is interpreted to be a + program name and wxLua will try to run it, any parameters after the + program name are pushed into the lua as a table named 'arg'.</li> + + <li>If you want to run a program or provide arguments to + your lua program that use -X or /X semantics you need to use + -- to stop the wxLua program from interpreting the args.</li> + + <ul> + + <li>In the example below, we don't want wxLua to + interpret the second -c or give an error for the -g arg, but + rather pass the args to myprogram.lua.</li> + + <li><i>wxLua -c -e "a = 12; b = 3" -- myprogram.lua + -c 12 -g</i><br> + + </li> + + <ul> + + <li>The wxLua program will display a console window to + display print statements, run the string "a = 12; b = 3", then + run myprogram.lua and push into lua a table named 'arg' with the + indicies </li> + + <li>[-5] = 'd:\wxLua\bin\wxlua.exe', [-4] = '-c', [-3] + = '-e', [-2] = 'a = 12; b = 3', [-1] = '--', [0] + = '../samples/unittest.wx.lua'</li> + + <li>[1] = '-c', [2] = '12', [3] + = '-g'</li> + + <li>This is the same table the lua executable + creates, where 0 = the name of the lua program run and positive indices + are args to the lua program and the most negative index is the name of + the executable.</li> + + </ul> + + <li>wxLua -c -e "a = 12; b = 3" -r myprogram.lua -- -c 12 + -g</li> + + <ul> + + <li>Gives the same results, but the lua arg + table starts with [1] = '--' which should probably be ignored.</li> + + </ul> + + </ul> + + </ul> + </ul> |