From c8ea111166d55ec0bc12f08694117b974d570da8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 15 May 2006 15:14:37 +0000 Subject: [PATCH] usage() function --- progs/xdemos/glxgears.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c index 00b05dc9807..304fd4befa9 100644 --- a/progs/xdemos/glxgears.c +++ b/progs/xdemos/glxgears.c @@ -540,6 +540,17 @@ event_loop(Display *dpy, Window win) } +static void +usage(void) +{ + printf("Usage:\n"); + printf(" -display set the display to run on\n"); + printf(" -stereo run in stereo mode\n"); + printf(" -fullscreen run in fullscreen mode\n"); + printf(" -info display OpenGL renderer info\n"); +} + + int main(int argc, char *argv[]) { @@ -564,8 +575,10 @@ main(int argc, char *argv[]) else if (strcmp(argv[i], "-fullscreen") == 0) { fullscreen = GL_TRUE; } - else - printf("Warrning: unknown parameter: %s\n", argv[i]); + else { + usage(); + return -1; + } } dpy = XOpenDisplay(dpyName); -- 2.30.2