diff options
author | Josh Haberman <jhaberman@gmail.com> | 2017-07-05 15:12:59 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2017-07-05 15:12:59 -0700 |
commit | dd536fd567b2ba9bed67a0094c5cd905c774f951 (patch) | |
tree | d1ffc80eb964b28ac15d4c2e0fb2e24a34374e4b /tools/upbc.lua | |
parent | 9cb10577fcefa3ed004e0bbdc61e6238e8137e3c (diff) |
Be more picky about command-line args in upbc.
Diffstat (limited to 'tools/upbc.lua')
-rw-r--r-- | tools/upbc.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/upbc.lua b/tools/upbc.lua index bf9a68d..9d9531c 100644 --- a/tools/upbc.lua +++ b/tools/upbc.lua @@ -15,8 +15,13 @@ local upb = require "upb" local generate_upbdefs = false for _, argument in ipairs(arg) do - if argument == "--generate-upbdefs" then - generate_upbdefs = true + if argument.sub(argument, 1, 2) == "--" then + if argument == "--generate-upbdefs" then + generate_upbdefs = true + else + print("Unknown flag: " .. argument) + return 1 + end else src = argument end |