Use real program name for help message 81/9381/1
authorStéphane Aulery <lkppo@free.fr>
Sun, 7 Jul 2013 01:15:39 +0000 (03:15 +0200)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 3 Sep 2013 04:07:00 +0000 (00:07 -0400)
Change-Id: Iad8837a2fb1fa4060d3ad9e4c0555e9ec2bc6691
Signed-off-by: Stéphane Aulery <lkppo@free.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xvinfo.c

index 8df7aa6..f1a6056 100644 (file)
--- a/xvinfo.c
+++ b/xvinfo.c
 #include <string.h>
 #include <ctype.h>
 
+static char *progname;
+
 static void _X_NORETURN
 PrintUsage(void)
 {
-    fprintf(stderr, "Usage:  xvinfo [-display host:dpy] [-short] [-version]\n");
+    fprintf(stderr, "Usage: %s [-display host:dpy] [-short] [-version]\n", progname);
     exit(0);
 }
 
@@ -33,6 +35,8 @@ main(int argc, char *argv[])
     char *disname = NULL;
     char shortmode = 0;
 
+    progname = argv[0];
+
     if ((argc > 4))
         PrintUsage();