Re: Auto-detecting whether script is stand-alone or module?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Auto-detecting whether script is stand-alone or module?
- From: Patrick <patrick@...>
- Date: 2013年1月03日 20:39:01 -0500
On 13-01-03 07:47 PM, František Fuka wrote:
Hello,
is there a way for a piece of Lua code to detect if it has been called
as a standalone script from command line, or loaded during require()
or dofile()?
Hi František
What about arg[0], that should be the scripts name-Patrick