Closed edubart closed 5 years ago
@edubart did you get a solution for this?
It's not possible to disable option handling after parsing has started.
You could use lua test.lua -s file -- a1 a2 -c
instead.
@daurnimator I made a "hack" by injecting --
into the args just after parsing the first input argument. Not a pretty solution, but worked for me, the code can be seen here:
https://github.com/edubart/euluna-lang/blob/master/euluna/configer.lua#L38
I am unable to stop handling option parsing after some argument. This is useful for creating scripts that need to pass arguments when invoking shell commands. For example this sample code does not work as intended:
When running with
lua test.lua -s file a1 a2 -c
:What I would expect is when input is consumed the
argparser:handle_options(false)
would cancel argparser to handle options and the above example would outputsa1 a2 -c
.