From: Chad Versace Date: Wed, 27 May 2015 23:14:26 +0000 (-0700) Subject: vk/glsl: Reject invalid options X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4514e63893bf3dada0fb88cdb127ae6fcc1c9bfd;p=mesa.git vk/glsl: Reject invalid options The script incorrectly interpreted --blah as the input filename. --- diff --git a/src/vulkan/glsl_scraper.py b/src/vulkan/glsl_scraper.py index c2f0495d4bc..c213f702b18 100644 --- a/src/vulkan/glsl_scraper.py +++ b/src/vulkan/glsl_scraper.py @@ -26,6 +26,11 @@ def print_usage(err): --with-glslang=PATH Full path to the glslangValidator program""")) exit(err) +def usage_error(msg): + print('usage error: {}'.format(msg)) + print('') + print_usage(1) + class Shader: def __init__(self, stage): self.stream = cStringIO.StringIO() @@ -217,6 +222,8 @@ while arg_idx < len(sys.argv): glslang = sys.argv[arg_idx][len('--with-glslang='):] elif sys.argv[arg_idx] == '--glsl-only': glsl_only = True; + elif sys.argv[arg_idx].startswith('-'): + usage_error('unknown option {!r}'.format(sys.argv[arg_idx])) else: infname = sys.argv[arg_idx] break