Blame SOURCES/expect-5.45.4-unification-of-usage-and-man-page.patch

6b7353
diff -up expect5.45.4/expect.man.orig expect5.45.4/expect.man
6b7353
--- expect5.45.4/expect.man.orig	2018-08-29 10:43:24.112949065 +0200
6b7353
+++ expect5.45.4/expect.man	2018-08-29 10:45:47.652044587 +0200
6b7353
@@ -4,7 +4,7 @@ expect \- programmed dialogue with inter
6b7353
 .SH SYNOPSIS
6b7353
 .B expect
6b7353
 [
6b7353
-.B \-dDinN
6b7353
+.B \-dDhinNv
6b7353
 ]
6b7353
 [
6b7353
 .B \-c
6b7353
@@ -180,6 +180,9 @@ problems when reading from a fifo or std
6b7353
 If the string "\-" is supplied as a filename, standard input is read instead.
6b7353
 (Use "./\-" to read from a file actually named "\-".)
6b7353
 .PP
6b7353
+.B \-h
6b7353
+causes Expect to print its usage message and exit.
6b7353
+.PP
6b7353
 The
6b7353
 .B \-i
6b7353
 flag causes
6b7353
diff -up expect5.45.4/exp_main_sub.c.orig expect5.45.4/exp_main_sub.c
6b7353
--- expect5.45.4/exp_main_sub.c.orig	2018-02-04 11:43:58.000000000 +0100
6b7353
+++ expect5.45.4/exp_main_sub.c	2018-08-29 11:04:44.307916140 +0200
6b7353
@@ -72,7 +72,21 @@ usage(interp)
6b7353
 Tcl_Interp *interp;
6b7353
 {
6b7353
   char buffer [] = "exit 1";
6b7353
-  expErrorLog("usage: expect [-div] [-c cmds] [[-f] cmdfile] [args]\r\n");
6b7353
+  expErrorLog("usage: expect [-dDhinNv] [-c cmds] [[-[f|b]] cmdfile] [args]\r\n"
6b7353
+	"  Flags are as follows:\r\n"
6b7353
+	"  -b     prefaces a file from which to read commands from\r\n"
6b7353
+	"           (expect reads one line at a timei from the file)\r\n"
6b7353
+	"  -c     prefaces a command to be executed before any in the script,\r\n"
6b7353
+	"           may be used multiple times\r\n"
6b7353
+	"  -d     enables diagnostic output\r\n"
6b7353
+	"  -D     enables interactive debugger\r\n"
6b7353
+	"  -f     prefaces a file from which to read commands from\r\n"
6b7353
+	"           (expect reads the whole file at once)\r\n"
6b7353
+	"  -h     prints this usage message and exits\r\n"
6b7353
+	"  -i     interactively prompts for commands\r\n"
6b7353
+	"  -n     expect doesn't read personal rc file\r\n"
6b7353
+	"  -N     expect doesn't read system-wide rc file\r\n"
6b7353
+	"  -v     prints version and exits\r\n");
6b7353
 
6b7353
   /* SF #439042 -- Allow overide of "exit" by user / script
6b7353
    */
6b7353
@@ -700,7 +714,7 @@ char **argv;
6b7353
          * and generate a usage message.
6b7353
 	 */
6b7353
 
6b7353
-	while ((c = getopt(argc, argv, "+b:c:dD:f:inN-v")) != EOF) {
6b7353
+	while ((c = getopt(argc, argv, "+b:c:dD:f:inN-vh")) != EOF) {
6b7353
 		switch(c) {
6b7353
 		case '-':
6b7353
 			/* getopt already handles -- internally, however */
6b7353
@@ -768,6 +782,9 @@ char **argv;
6b7353
 			  Tcl_Eval(interp, buffer); 
6b7353
 			}
6b7353
 			break;
6b7353
+		case 'h':
6b7353
+			usage(interp);
6b7353
+			break;
6b7353
 		default: usage(interp);
6b7353
 		}
6b7353
 	}