From 302d60a06171b3c7365b2818559217dacd28849d Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 15 Feb 2024 14:50:48 +0100 Subject: [PATCH] tokenize from cli (full circle) --- tokenize_args.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tokenize_args.lua b/tokenize_args.lua index bb434e4..1a737bc 100644 --- a/tokenize_args.lua +++ b/tokenize_args.lua @@ -60,10 +60,11 @@ function dump(t) end function main() - 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) - local split = tokenize_args(mockargs) + if arg[1] == nil then + print("need to give an argument (probably a string)") + return + end + local split = tokenize_args(arg[1]) print(dump(split)) end