[Midnightbsd-cvs] src [7842] trunk/usr.bin/ministat: add option to suppress the plot in ministat.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Tue Sep 6 21:50:12 EDT 2016


Revision: 7842
          http://svnweb.midnightbsd.org/src/?rev=7842
Author:   laffer1
Date:     2016-09-06 21:50:12 -0400 (Tue, 06 Sep 2016)
Log Message:
-----------
add option to suppress the plot in ministat. Obtained from: FreeBSD svn 244279

Modified Paths:
--------------
    trunk/usr.bin/ministat/ministat.1
    trunk/usr.bin/ministat/ministat.c

Modified: trunk/usr.bin/ministat/ministat.1
===================================================================
--- trunk/usr.bin/ministat/ministat.1	2016-09-07 01:48:15 UTC (rev 7841)
+++ trunk/usr.bin/ministat/ministat.1	2016-09-07 01:50:12 UTC (rev 7842)
@@ -25,7 +25,7 @@
 .\"
 .\" $MidnightBSD$
 .\"
-.Dd June 28, 2010
+.Dd November 10, 2012
 .Dt MINISTAT 1
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 .Nd statistics utility
 .Sh SYNOPSIS
 .Nm
-.Op Fl ns
+.Op Fl Ans
 .Op Fl C Ar column
 .Op Fl c Ar confidence_level
 .Op Fl d Ar delimiter
@@ -47,6 +47,9 @@
 .Pp
 The options are as follows:
 .Bl -tag -width Fl
+.It Fl A
+Just report the statistics of the input and relative comparisons,
+suppress the ASCII-art plot.
 .It Fl n
 Just report the raw statistics of the input, suppress the ASCII-art plot
 and the relative comparisons.

Modified: trunk/usr.bin/ministat/ministat.c
===================================================================
--- trunk/usr.bin/ministat/ministat.c	2016-09-07 01:48:15 UTC (rev 7841)
+++ trunk/usr.bin/ministat/ministat.c	2016-09-07 01:50:12 UTC (rev 7842)
@@ -509,7 +509,7 @@
 
 	fprintf(stderr, "%s\n", whine);
 	fprintf(stderr,
-	    "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-ns] [-w width] [file [file ...]]\n");
+	    "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Ans] [-w width] [file [file ...]]\n");
 	fprintf(stderr, "\tconfidence = {");
 	for (i = 0; i < NCONF; i++) {
 		fprintf(stderr, "%s%g%%",
@@ -517,6 +517,7 @@
 		    studentpct[i]);
 	}
 	fprintf(stderr, "}\n");
+	fprintf(stderr, "\t-A : print statistics only. suppress the graph.\n");
 	fprintf(stderr, "\t-C : column number to extract (starts and defaults to 1)\n");
 	fprintf(stderr, "\t-d : delimiter(s) string, default to \" \\t\"\n");
 	fprintf(stderr, "\t-n : print summary statistics only, no graph/test\n");
@@ -538,6 +539,7 @@
 	int flag_s = 0;
 	int flag_n = 0;
 	int termwidth = 74;
+	int suppress_plot = 0;
 
 	if (isatty(STDOUT_FILENO)) {
 		struct winsize wsz;
@@ -550,8 +552,11 @@
 	}
 
 	ci = -1;
-	while ((c = getopt(argc, argv, "C:c:d:snw:")) != -1)
+	while ((c = getopt(argc, argv, "AC:c:d:snw:")) != -1)
 		switch (c) {
+		case 'A':
+			suppress_plot = 1;
+			break;
 		case 'C':
 			column = strtol(optarg, &p, 10);
 			if (p != NULL && *p != '\0')
@@ -610,7 +615,7 @@
 	for (i = 0; i < nds; i++) 
 		printf("%c %s\n", symbol[i+1], ds[i]->name);
 
-	if (!flag_n) {
+	if (!flag_n && !suppress_plot) {
 		SetupPlot(termwidth, flag_s, nds);
 		for (i = 0; i < nds; i++)
 			DimPlot(ds[i]);



More information about the Midnightbsd-cvs mailing list