diff options
author | Christian König <[email protected]> | 2010-11-21 19:40:52 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2010-11-21 19:40:52 +0100 |
commit | e6b71530daea3059ee362d4df51575e27e026b22 (patch) | |
tree | 8df01693aa4bf44360647d79a340cbb4156aa91a /src/glsl/main.cpp | |
parent | 42c7291d2cb50c2bd94dd9346a8402a24303d66d (diff) | |
parent | 5e3733fadf08178fca7c9f20a0f4783f940383aa (diff) |
Merge remote branch 'origin/master' into pipe-video
Conflicts:
src/gallium/auxiliary/Makefile
src/gallium/auxiliary/SConscript
Diffstat (limited to 'src/glsl/main.cpp')
-rw-r--r-- | src/glsl/main.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index 08a44c96e57..33028512644 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -146,15 +146,6 @@ load_text_file(void *ctx, const char *file_name) return text; } - -void -usage_fail(const char *name) -{ - printf("%s <filename.frag|filename.vert>\n", name); - exit(EXIT_FAILURE); -} - - int glsl_es = 0; int dump_ast = 0; int dump_hir = 0; @@ -170,6 +161,25 @@ const struct option compiler_opts[] = { { NULL, 0, NULL, 0 } }; +/** + * \brief Print proper usage and exit with failure. + */ +void +usage_fail(const char *name) +{ + + const char *header = + "usage: %s [options] <file.vert | file.geom | file.frag>\n" + "\n" + "Possible options are:\n"; + printf(header, name, name); + for (const struct option *o = compiler_opts; o->name != 0; ++o) { + printf(" --%s\n", o->name); + } + exit(EXIT_FAILURE); +} + + void compile_shader(struct gl_context *ctx, struct gl_shader *shader) { |