diff options
| author | Adam Harrison <adamdharrison@gmail.com> | 2021-06-27 18:11:16 -0400 |
|---|---|---|
| committer | Adam Harrison <adamdharrison@gmail.com> | 2021-06-27 18:11:16 -0400 |
| commit | 13b3943455a83acf0073f9f021a91ac28714a5e8 (patch) | |
| tree | 3553615685b2e0c80a4f2cf8cb77e9b598b0ab6f | |
| parent | 1e1afb206bf7e37d7394874bd066cdefda20432d (diff) | |
| download | lite-xl-simplifying-main.tar.gz lite-xl-simplifying-main.zip | |
Made sure ARGS worked backwards-compatibly.simplifying-main
| -rw-r--r-- | data/core/start.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/data/core/start.lua b/data/core/start.lua index 5e0ff4bc..b76aefee 100644 --- a/data/core/start.lua +++ b/data/core/start.lua @@ -22,9 +22,9 @@ package.path = USERDIR .. '/?/init.lua;' .. package.path local function arg_error(error) io.stderr:write(ARGV[1] .. ": " .. error .. "\n") os.exit(-1) end -- returns a lua table with both numeric and non-numeric keys like getoptlong local function parse_args_to_dict_and_array(argv, t) - local options, arg = {} + local options, arg = { argv[1] } local function parse_value(value) - if t[arg] == "i" and not tonumber(value) then + if t[arg] == "i" and not tonumber(value) or (#t[arg] and #value == 0) then arg_error("error parsing argument " .. value) end options[arg], arg = t[arg] == "i" and tonumber(value) or value, nil |
