-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pl.lapp: Support end-of-argument-list marker "--" #191
Comments
Minimally invasive patch against Penlight 1.2.1 that makes this work: --- /usr/share/lua/5.2/pl/lapp.lua 2013-09-01 01:39:16.000000000 +0200
+++ pl/lapp.lua 2016-04-07 17:18:04.719756774 +0200
@@ -304,6 +304,7 @@
local iextra = 1
local i = 1
local parm,ps,val
+ local end_of_flags = false
local function check_parm (parm)
local eqi = parm:find '='
@@ -321,8 +322,20 @@
while i <= #arg do
local theArg = arg[i]
local res = {}
+ if theArg == "--" then
+ end_of_flags = true
+ iparm = #parmlist + 1
+
+ i = i + 1
+ theArg = arg[i]
+
+ if not theArg then
+ break
+ end
+ end
+
-- look for a flag, -<short flags> or --<long flag>
- if match('--$S{long}',theArg,res) or match('-$S{short}',theArg,res) then
+ if not end_of_flags and (match('--$S{long}',theArg,res) or match('-$S{short}',theArg,res)) then
if res.long then -- long option
parm = check_parm(res.long)
elseif #res.short == 1 or is_flag(res.short) then |
The patch misbehaved if -- theArg = arg[i]
if not theArg then
break
end |
ghost
pushed a commit
to devurandom/lua-runtemplate
that referenced
this issue
Apr 7, 2016
pl/lapp.lua, penlight-1.2.1-lapp-issue-191-end-of-args-marker.patch: - lunarmodules/Penlight#191
ghost
pushed a commit
to devurandom/lua-runtemplate
that referenced
this issue
Apr 7, 2016
pl/lapp.lua, penlight-1.2.1-lapp-issue-191-end-of-args-marker.patch: - lunarmodules/Penlight#191
ghost
pushed a commit
to devurandom/lua-runtemplate
that referenced
this issue
Apr 7, 2016
pl/lapp.lua, penlight-1.2.1-lapp-issue-191-end-of-args-marker.patch: - lunarmodules/Penlight#191
ghost
pushed a commit
to devurandom/lua-runtemplate
that referenced
this issue
Apr 7, 2016
pl/lapp.lua, penlight-1.2.1-lapp-issue-191-end-of-args-marker.patch: - lunarmodules/Penlight#191
ghost
pushed a commit
to devurandom/lua-runtemplate
that referenced
this issue
Apr 7, 2016
pl/lapp.lua, penlight-1.2.1-lapp-issue-191-end-of-args-marker.patch: - lunarmodules/Penlight#191
ghost
pushed a commit
to devurandom/lua-runtemplate
that referenced
this issue
Apr 7, 2016
pl/lapp.lua, penlight-1.2.1-lapp-issue-191-end-of-args-marker.patch: - lunarmodules/Penlight#191
stevedonovan
added a commit
that referenced
this issue
Jul 23, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be great of
pl.lapp
could support the end-of-argument-list marker--
.Let's take this
example.lua
:I would expect to be able to call
example.lua
and see following output:Instead I get following error:
I cannot call
example.lua
without such--
marker, because that makespl.lapp
opensome
andargument
as input and output files:The text was updated successfully, but these errors were encountered: