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

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