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

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