lua-users home
lua-l archive

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


I was trying to use mpeterv's argparse module
(https://github.com/mpeterv/argparse) to make a script behave somewhat
like `cp` or `mv` in that all arguments except the last one belong to
the "input".

I tried, what I thought was the obvious:
> parser:argument("input"):args("+") -- at least 1 arg
> parser:argument("output"):args(1)  -- exactly 1 arg
but I just get "Error: missing argument 'output'" from it.

Is there a way to have the module populate "output" for me?  Or should I
just do it myself by having the module read them all into "input" and
then removing the last one from the table?

Attachment: signature.asc
Description: OpenPGP digital signature