Skip to content

Commit 17c79c5

Browse files
committed
CL: Added --version option.
1 parent ffd695a commit 17c79c5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

preprocess-cl.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ exec lua "$0" "$@"
110110
Only print errors to the console. (This flag is automatically
111111
enabled if an output path is stdout.)
112112
113+
--version
114+
Print the version of LuaPreprocess and exit.
115+
113116
--debug
114117
Enable some preprocessing debug features. Useful if you want
115118
to inspect the generated metaprogram (*.meta.lua). (This also
@@ -360,6 +363,14 @@ for _, arg in ipairs(args) do
360363
elseif arg:find"^%-%-loglevel=" then
361364
maxLogLevel = arg:gsub("^.-=", "")
362365

366+
elseif arg == "--version" then
367+
print(pp.VERSION)
368+
os.exit()
369+
370+
-- elseif arg == "/?" or arg:find"^%-%-?help" or arg:lower() == "/help" then
371+
-- -- @Incomplete!
372+
-- os.exit()
373+
363374
else
364375
errorLine("Unknown option '"..arg:gsub("=.*", "").."'.")
365376
end

preprocess.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--[[============================================================
22
--=
3-
--= LuaPreprocess v1.19 - preprocessing library
3+
--= LuaPreprocess v1.19-dev - preprocessing library
44
--= by Marcus 'ReFreezed' Thunström
55
--=
66
--= License: MIT (see the bottom of this file)
@@ -131,7 +131,7 @@
131131

132132

133133

134-
local PP_VERSION = "1.19.0"
134+
local PP_VERSION = "1.19.0-dev"
135135

136136
local MAX_DUPLICATE_FILE_INSERTS = 1000 -- @Incomplete: Make this a parameter for processFile()/processString().
137137

0 commit comments

Comments
 (0)