[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: standalone modules
- From: "Francisco Sant'anna" <francisco.santanna@...>
- Date: Mon, 11 Jun 2007 21:40:39 -0300
Hello,
When creating a module sometimes is also useful to run it from the command line as a standalone application.
How to discover the invoke method?
Here's how I'm doing now:
-- checks if the module is being 'required' or executed
local STANDALONE = (debug.getinfo(1).short_src == (arg and arg[0]))
module ((...) or 'default_name')
...
if STANDALONE then
whatever()
end