bugfix
This commit is contained in:
parent
3e3855bc8a
commit
7176181aef
|
@ -8,7 +8,7 @@ function tokenize_args(raw)
|
||||||
-- '*?' does not work
|
-- '*?' does not work
|
||||||
-- '|' is not or
|
-- '|' is not or
|
||||||
--
|
--
|
||||||
-- This means we're better of implementing a programatic lexer.
|
-- This means we're better of implementing the lexer with an algorithm.
|
||||||
local t = {}
|
local t = {}
|
||||||
local current = ""
|
local current = ""
|
||||||
local in_str = false
|
local in_str = false
|
||||||
|
@ -33,7 +33,9 @@ function tokenize_args(raw)
|
||||||
current = current .. c
|
current = current .. c
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(t, current)
|
if string.len(current) > 0 then
|
||||||
|
table.insert(t, current)
|
||||||
|
end
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -58,7 +60,8 @@ function dump(t)
|
||||||
end
|
end
|
||||||
|
|
||||||
function main()
|
function main()
|
||||||
local mockargs = [[-iab --foo '{"QUX": "BAR"}' --ala=boa]]
|
local mockargs =
|
||||||
|
[[--name "tls_service_rs" --base-dir ${PWD%/*/*} --log-level "TRACE" -j '{ "MODE": "server", "CERT": "data/server.crt", "KEY": "data/server.key", "CHAIN": "data/root.crt", "ADDR": "127.0.0.1:9999", "HOSTNAME": "localhost" }']]
|
||||||
print(mockargs)
|
print(mockargs)
|
||||||
local split = tokenize_args(mockargs)
|
local split = tokenize_args(mockargs)
|
||||||
print(dump(split))
|
print(dump(split))
|
||||||
|
|
Loading…
Reference in New Issue