From dd536fd567b2ba9bed67a0094c5cd905c774f951 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 5 Jul 2017 15:12:59 -0700 Subject: [PATCH] Be more picky about command-line args in upbc. --- tools/upbc.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/upbc.lua b/tools/upbc.lua index bf9a68d36a..9d9531c00c 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