Reputation: 430
I need to find the name of the Lua executeable from within a Lua script as it sets up a task for later execution.
Using arg
I can find out the name, however this becomes un reliable if options are used. For example, if no arguments are used running within a script print( arg[-1])
would print lua53
. However if options are used they would be printed instead, such as -i
, and to get the exe I would have change the line to print( arg[-2])
.
What method will reliably get the name of the lua binary?
Upvotes: 1
Views: 168