[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua CLI: how to pass arguments to -e
- From: Alexander Gladysh <agladysh@...>
- Date: Mon, 13 Dec 2010 06:47:30 +0300
On Sun, Dec 12, 2010 at 20:56, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> I want to pass command line arguments to a piece of code, that I
>> specify with -e:
>> $ lua -e 'print(...)' 1 2 3
> The patch below is a hack that seems to (almost) work.
> To avoid the message "cannot open 1", you need to do
> lua -e'print("test",...);os.exit()' 1 2 3
> or add a '-E' option as suggested earlier.
> In any case, it is a hack.
Thanks.
But (I should have said this earlier, my fault) I'm using LuaJIT.
Anyway, Patrick's workaround seems to work for me.
Still, I'd consider this to be a misfeature, probably worth fixing in
5.2. (Unless there are some problems I do not see, of course.)
Alexander.