aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-08-23 08:26:32 -0700
committerChad Versace <chad.versace@linux.intel.com>2012-08-23 10:08:41 -0700
commit2d1abe88ec1174f2d1362bad9da37f1c7a0e6e3a (patch)
treedf1da3383ffbca730a019c38868429a8d0a23499 /examples
parent87550bfaddc3226dc413c5e9efb909d222a1d43a (diff)
downloadwaffle-2d1abe88ec1174f2d1362bad9da37f1c7a0e6e3a.tar.gz
gl_basic: Print usage error and exit if invalid args are given
This patch also adds missing newlines to those error messages. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/gl_basic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/gl_basic.c b/examples/gl_basic.c
index 6f64016..c7f28b5 100644
--- a/examples/gl_basic.c
+++ b/examples/gl_basic.c
@@ -211,16 +211,16 @@ parse_args(int argc, char *argv[], struct options *opts)
arg = argv[1];
ok = enum_map_translate_str(platform_map, arg, &opts->platform);
if (!ok) {
- fprintf(stderr, "error: '%s' is not a valid platform", arg);
- return false;
+ fprintf(stderr, "error: '%s' is not a valid platform\n", arg);
+ error_usage();
}
// Set context_api.
arg = argv[2];
ok = enum_map_translate_str(context_api_map, arg, &opts->context_api);
if (!ok) {
- fprintf(stderr, "error: '%s' is not a valid API for a GL context", arg);
- return false;
+ fprintf(stderr, "error: '%s' is not a valid API for a GL context\n", arg);
+ error_usage();
}
// Set dl.