[Rpm-maint] [rpm-software-management/rpm] RFE: pass parametric macro options and arguments to Lua natively (#1092)
Panu Matilainen
notifications at github.com
Thu Oct 8 03:36:12 UTC 2020
We can't pass NULL's in middle of ARGV_t, but that gave me an idea...
What we could do is pass pass options and a table and the arguments as another, and prepend this to the anonymous Lua chunk from C side:
```
opt = select(1, ...)
arg = select(2, ...)
```
Which I think makes it all really nice on the Lua side:
```
%foo(a:b) %{lua
if opt.b
print('do b')
if opt.a
print('a value: '...opt.a)
for i in ipairs(i, arg) do
print(i, arg)
end
--- also these would work
if opt['b']:
print('do b')
print('first arg'..argv[1])
}
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1092#issuecomment-705309465
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201007/6b366e0a/attachment-0001.html>
More information about the Rpm-maint
mailing list