Closed bitinn closed 8 years ago
Another option might be love . -- --options
use --
as an indicator for parameters intended for the lua game script iteself.
Parser:parse()
can take an array of arguments to parse instead of global arg
. You can create a copy of it but without the dot argument, or just remove it from the original using table.remove(arg, 1)
if you don't mind mutating it.
Ah great, I should read the doc more carefully
This might sound strange. But instead of
lua script.lua --options
, I am doinglove . --options
as I am using the LOVE engine.Currently argparse expects me to add a
parser:argument
to account for the.
folder, which is fine. But the help message isn't really what we want:Usage: love [-d] [-h] <folder/>
love
itself takes parameter solove -d .
won't do much good.I think a better option would be to enable argument parsing offset, ignore the
.
as it's handled by LOVE. I know this is rather an edge case, so it's up to your decision.ref: https://love2d.org/wiki/Getting_Started