[PATCH xvinfo] Use real program name for help message

Stéphane Aulery lkppo at free.fr
Sat Jul 6 18:15:39 PDT 2013


Signed-off-by: Stéphane Aulery <lkppo at free.fr>
---
 xvinfo.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xvinfo.c b/xvinfo.c
index 8df7aa6..f1a6056 100644
--- a/xvinfo.c
+++ b/xvinfo.c
@@ -10,10 +10,12 @@
 #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();
 
-- 
1.7.10.4



More information about the xorg-devel mailing list