diff options
author | Carl Worth <[email protected]> | 2014-06-25 11:46:49 -0700 |
---|---|---|
committer | Carl Worth <[email protected]> | 2014-07-29 15:11:49 -0700 |
commit | 2fdc1f50c46b7f0a6abd8b2ef4739ac96958cb0a (patch) | |
tree | 390df03c14f647056df3efe0ebf3c3a97aee5930 /src/glsl/glcpp/glcpp.c | |
parent | 8e8f8ff1b25a4cfd332d9e7c86d3d56cdff98d6a (diff) |
glsl/glcpp: Add a -d/--debug option to the standalone glcpp program
The verbose debug output from the parser is quite useful when debugging, and
having this available as a command-line option is much more convenient than
manually forcing this into the code when needed, (which is what I had been
doing for too long previously).
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/glcpp.c')
-rw-r--r-- | src/glsl/glcpp/glcpp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c index 07b1500b6b8..ca188015c7e 100644 --- a/src/glsl/glcpp/glcpp.c +++ b/src/glsl/glcpp/glcpp.c @@ -124,6 +124,7 @@ enum { const static struct option long_options[] = { {"disable-line-continuations", no_argument, 0, DISABLE_LINE_CONTINUATIONS_OPT }, + {"debug", no_argument, 0, 'd'}, {0, 0, 0, 0 } }; @@ -140,11 +141,14 @@ main (int argc, char *argv[]) init_fake_gl_context (&gl_ctx); - while ((c = getopt_long(argc, argv, "", long_options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "d", long_options, NULL)) != -1) { switch (c) { case DISABLE_LINE_CONTINUATIONS_OPT: gl_ctx.Const.DisableGLSLLineContinuations = true; break; + case 'd': + glcpp_parser_debug = 1; + break; default: usage (); exit (1); |