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
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to