lua-users home
lua-l archive

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


2013/6/5 Geoff Leyland <geoff_leyland@fastmail.fm>:

> arg doesn't seem to be available to the command-line.
> Page 8 of PiL(2nd ed I'm afraid) says "A *script* can retrieve its arguments...".

In that case there is a quick answer to the FAQ:

    Can a program tell whether it is being run from the command line
    or from a script?

if (arg==nil) print
   "Running from the command line, unless you are trying to fool me."