Skip to content

Commit 05a6a90

Browse files
committed
add --pretty option
1 parent cdb981c commit 05a6a90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cli.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ local config;
4242
local sourceFile;
4343
local outFile;
4444
local luaVersion;
45+
local prettyPrint;
4546

4647
Prometheus.colors.enabled = true;
4748

@@ -87,6 +88,8 @@ while i <= #arg do
8788
luaVersion = "Lua51";
8889
elseif curr == "--LuaU" then
8990
luaVersion = "LuaU";
91+
elseif curr == "--pretty" then
92+
prettyPrint = true;
9093
else
9194
Prometheus.Logger:warn(string.format("The option \"%s\" is not valid and therefore ignored", curr));
9295
end
@@ -110,6 +113,7 @@ end
110113

111114
-- Add Option to override Lua Version
112115
config.LuaVersion = luaVersion or config.LuaVersion;
116+
config.PrettyPrint = prettyPrint ~= nil and prettyPrint or config.PrettyPrint;
113117

114118
if not file_exists(sourceFile) then
115119
Prometheus.Logger:error(string.format("The File \"%s\" was not found!", sourceFile));

0 commit comments

Comments
 (0)