aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2021-06-27 18:11:16 -0400
committerAdam Harrison <adamdharrison@gmail.com>2021-06-27 18:11:16 -0400
commit13b3943455a83acf0073f9f021a91ac28714a5e8 (patch)
tree3553615685b2e0c80a4f2cf8cb77e9b598b0ab6f
parent1e1afb206bf7e37d7394874bd066cdefda20432d (diff)
downloadlite-xl-simplifying-main.tar.gz
lite-xl-simplifying-main.zip
Made sure ARGS worked backwards-compatibly.simplifying-main
-rw-r--r--data/core/start.lua4
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