Skip to content

Commit

Permalink
Fix -O0 flag for pflua-expand tool
Browse files Browse the repository at this point in the history
As in pflua-compile, use the last argument as the filter,
so that -O0 flag can be used before it.

Also fix an extra hyphen in the usage message.
  • Loading branch information
mpeterv committed May 21, 2015
1 parent a518e4f commit 3b6e6f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/pflua-expand
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local function usage()
local content = [=[
Usage: pflua-expand [-O0] <pflang-expression>
Options:
--O0 Disable optimizations; optimizations are on by default.]=]
-O0 Disable optimizations; optimizations are on by default.]=]
print(content);
os.exit()
end
Expand All @@ -27,7 +27,8 @@ if flags["--help"] or flags["-h"] then
usage()
end

local expanded = pf.expand.expand(pf.parse.parse(arg[1]), "EN10MB")
local filter = arg[#arg]
local expanded = pf.expand.expand(pf.parse.parse(filter), "EN10MB")
if flags["-O0"] then
utils.pp(expanded)
else
Expand Down

0 comments on commit 3b6e6f5

Please sign in to comment.