3
function getopt( arg, options )
5
for k, v in ipairs(arg) do
6
if string.sub( v, 1, 2) == "--" then
7
local x = string.find( v, "=", 1, true )
8
if x then tab[ string.sub( v, 3, x-1 ) ] = string.sub( v, x+1 )
9
else tab[ string.sub( v, 3 ) ] = true
11
elseif string.sub( v, 1, 1 ) == "-" then
13
local l = string.len(v)
16
jopt = string.sub( v, y, y )
17
if string.find( options, jopt, 1, true ) then
19
tab[ jopt ] = string.sub( v, y+1 )
22
tab[ jopt ] = arg[ k + 1 ]
b'\\ No newline at end of file'