[PATCH 1/2 xvidtune] Use real program name for help message

Stéphane Aulery lkppo at free.fr
Wed Jul 3 15:29:54 PDT 2013


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

diff --git a/xvidtune.c b/xvidtune.c
index ac339e4..18b67d5 100644
--- a/xvidtune.c
+++ b/xvidtune.c
@@ -55,6 +55,8 @@ static int dot_clock, mode_flags;
 static unsigned long TestTimeout=5000;  /* Default test timeout */
 static XtSignalId sigId;
 
+static char *progname;
+
 /* Minimum extension version required */
 #define MINMAJOR 0
 #define MINMINOR 5
@@ -1477,7 +1479,7 @@ PrevModeAction(Widget w, XEvent* e, String* vector, Cardinal* count)
 static void
 usage(void)
 {
-    fprintf(stderr, "Usage: xvidtune [option]\n");
+    fprintf(stderr, "Usage: %s [option]\n", progname);
     fprintf(stderr, "    where option is one of:\n");
     fprintf(stderr, "        -show                             Print current modeline to stdout\n");
     fprintf(stderr, "        -next                             Switch to next video mode\n");
@@ -1495,6 +1497,8 @@ main (int argc, char** argv)
     XtAppContext app;
     Display* dpy;
     Bool modeSettable = TRUE;
+
+    progname = argv[0];
     
     static XtActionsRec actions[] = { { "xvidtune-quit", QuitAction },
 				      { "xvidtune-restore", RestoreAction },
-- 
1.7.10.4



More information about the xorg-devel mailing list