summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.lua b/main.lua
index 40703350..edbdae8c 100644
--- a/main.lua
+++ b/main.lua
@@ -5,11 +5,12 @@ local version = require 'version'
local function loadArgs()
for _, v in ipairs(arg) do
---@type string
- local key, value = v:match '^%-%-([%w_]+)%=(.+)'
+ local key, tail = v:match '^%-%-([%w_]+)(.*)$'
if not key then
goto CONTINUE
end
- if value == 'true' then
+ local value = tail:match '=(.+)'
+ if value == 'true' or value == nil then
value = true
elseif value == 'false' then
value = false
@@ -32,6 +33,11 @@ ROOT = fs.path(util.expandPath(rootPath))
LOGPATH = LOGPATH and util.expandPath(LOGPATH) or (ROOT:string() .. '/log')
METAPATH = METAPATH and util.expandPath(METAPATH) or (ROOT:string() .. '/meta')
+if _G['VERSION'] then
+ print(version.getVersion())
+ return
+end
+
---@diagnostic disable-next-line: deprecated
debug.setcstacklimit(200)
--collectgarbage('generational', 5, 25)