[4.1] a2e1557 Update params and minor style changes

Federico G. Schwindt fgsch at lodoss.net
Mon Sep 28 13:31:07 CEST 2015


commit a2e15572b2c8349f263b3c653eae2682932a848e
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Sep 21 13:08:33 2015 +0100

    Update params and minor style changes

diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index 60b6fcb..9c9f255 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -126,17 +126,19 @@ usage(void)
 {
 	fprintf(stderr, "usage: varnishtest [options] file ...\n");
 #define FMT "    %-28s # %s\n"
-	fprintf(stderr, FMT, "-b size", "Set internal buffer size (default: 512K)");
+	fprintf(stderr, FMT, "-b size",
+	    "Set internal buffer size (default: 512K)");
 	fprintf(stderr, FMT, "-D name=val", "Define macro");
 	fprintf(stderr, FMT, "-i", "Find varnishd in build tree");
 	fprintf(stderr, FMT, "-j jobs", "Run this many tests in parallel");
 	fprintf(stderr, FMT, "-k", "Continue on test failure");
-	fprintf(stderr, FMT, "-l", "Leave temporary vtc.* if test fails");
 	fprintf(stderr, FMT, "-L", "Always leave temporary vtc.*");
+	fprintf(stderr, FMT, "-l", "Leave temporary vtc.* if test fails");
 	fprintf(stderr, FMT, "-n iterations", "Run tests this many times");
 	fprintf(stderr, FMT, "-q", "Quiet mode: report only failures");
 	fprintf(stderr, FMT, "-t duration", "Time tests out after this long");
 	fprintf(stderr, FMT, "-v", "Verbose mode: always report test log");
+	fprintf(stderr, FMT, "-W", "Enable the witness facility for locking");
 	fprintf(stderr, "\n");
 	exit(1);
 }
@@ -457,17 +459,17 @@ main(int argc, char * const *argv)
 
 	setbuf(stdout, NULL);
 	setbuf(stderr, NULL);
-	while ((ch = getopt(argc, argv, "b:D:ij:klLn:qt:vW")) != -1) {
+	while ((ch = getopt(argc, argv, "b:D:hij:kLln:qt:vW")) != -1) {
 		switch (ch) {
 		case 'b':
 			if (VNUM_2bytes(optarg, &bufsiz, 0)) {
 				fprintf(stderr, "Cannot parse b opt '%s'\n",
-					optarg);
+				    optarg);
 				exit(2);
 			}
 			if (bufsiz > UINT_MAX) {
 				fprintf(stderr, "Invalid b opt '%s'\n",
-					optarg);
+				    optarg);
 				exit(2);
 			}
 			vtc_bufsiz = (unsigned)bufsiz;
@@ -475,7 +477,7 @@ main(int argc, char * const *argv)
 		case 'D':
 			if (!parse_D_opt(optarg)) {
 				fprintf(stderr, "Cannot parse D opt '%s'\n",
-					optarg);
+				    optarg);
 				exit(2);
 			}
 			break;
@@ -485,12 +487,12 @@ main(int argc, char * const *argv)
 		case 'j':
 			npar = strtoul(optarg, NULL, 0);
 			break;
-		case 'l':
-			leave_temp = 1;
-			break;
 		case 'L':
 			leave_temp = 2;
 			break;
+		case 'l':
+			leave_temp = 1;
+			break;
 		case 'k':
 			vtc_continue = !vtc_continue;
 			break;
diff --git a/doc/sphinx/reference/varnishtest.rst b/doc/sphinx/reference/varnishtest.rst
index 00828ff..5bfca7b 100644
--- a/doc/sphinx/reference/varnishtest.rst
+++ b/doc/sphinx/reference/varnishtest.rst
@@ -15,7 +15,7 @@ Test program for Varnish
 SYNOPSIS
 ========
 
-varnishtest [-iklLqv] [-n iter] [-b size] [-D name=val] [-j jobs] [-t duration] file [file ...]
+varnishtest [-hikLlqvW] [-b size] [-D name=val] [-j jobs] [-n iter] [-t duration] file [file ...]
 
 DESCRIPTION
 ===========
@@ -34,16 +34,18 @@ The following options are available:
 
 -D name=val      Define macro for use in scripts
 
+-h               Show help
+
 -i               Find varnishd in build tree
 
 -j jobs          Run this many tests in parallel
 
 -k               Continue on test failure
 
--l               Leave temporary vtc.* if test fails
-
 -L               Always leave temporary vtc.*
 
+-l               Leave temporary vtc.* if test fails
+
 -n iterations    Run tests this many times
 
 -q               Quiet mode: report only failures
@@ -54,8 +56,6 @@ The following options are available:
 
 -W               Enable the witness facility for locking
 
--h               Show help
-
 file             File to use as a script
 
 



More information about the varnish-commit mailing list