lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Jerome Vuarand wrote:
BTW I recently had some problems to redefine dynamically LUA_PATH for a
lua interpreter on windows. With the default windows shell you cannot
redefine environment variables on a per-command basis (unlike unix
shells). And to avoid polluting the current shell you have to use
setlocal/endlocal in batch files, which have further drawbacks.

It would be a nice addition to add a standard command line switch to the
stock lua interperter to override LUA_PATH and LUA_CPATH. Something

lua -p 'foo\?.lua' -cp 'bar\?.dll' -lfoo -lbar test.lua

instead of:

LUA_PATH='foo\?.lua' LUA_CPATH='bar\?.dll' lua -lfoo -lbar test.lua

Bear with me because I might be missing something, but wouldn't

   lua -e "package.path, package.cpath = '/lua', '/lib'" -lfoo -lbar test.lua

suffice? -l after -e respects the new setting, and package.path and package.cpath seem writable...

 - Peter Odding