diff --git a/usr.bin/ministat/ministat.1 b/usr.bin/ministat/ministat.1 --- a/usr.bin/ministat/ministat.1 +++ b/usr.bin/ministat/ministat.1 @@ -33,7 +33,7 @@ .Nd statistics utility .Sh SYNOPSIS .Nm -.Op Fl Ans +.Op Fl Anqs .Op Fl C Ar column .Op Fl c Ar confidence_level .Op Fl d Ar delimiter @@ -53,6 +53,10 @@ .It Fl n Just report the raw statistics of the input, suppress the ASCII-art plot and the relative comparisons. +.It Fl q +Suppress printing of summary statistics and data-set names; typically for use +alongside +.Fl n . .It Fl s Print the average/median/stddev bars on separate lines in the ASCII-art plot, to avoid overlap. diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -533,7 +533,7 @@ fprintf(stderr, "%s\n", whine); fprintf(stderr, - "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Ans] [-w width] [file [file ...]]\n"); + "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Anqs] [-w width] [file [file ...]]\n"); fprintf(stderr, "\tconfidence = {"); for (i = 0; i < NCONF; i++) { fprintf(stderr, "%s%g%%", @@ -545,6 +545,7 @@ 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"); + fprintf(stderr, "\t-q : suppress printing summary-statistics headers and data-set names\n"); fprintf(stderr, "\t-s : print avg/median/stddev bars on separate lines\n"); fprintf(stderr, "\t-w : width of graph/test output (default 74 or terminal width)\n"); exit (2); @@ -564,6 +565,7 @@ int column = 1; int flag_s = 0; int flag_n = 0; + int flag_q = 0; int termwidth = 74; int suppress_plot = 0; @@ -578,7 +580,7 @@ } ci = -1; - while ((c = getopt(argc, argv, "AC:c:d:snw:")) != -1) + while ((c = getopt(argc, argv, "AC:c:d:snqw:")) != -1) switch (c) { case 'A': suppress_plot = 1; @@ -608,6 +610,9 @@ case 'n': flag_n = 1; break; + case 'q': + flag_q = 1; + break; case 's': flag_s = 1; break; @@ -664,8 +669,10 @@ fclose(setfiles[i]); } - for (i = 0; i < nds; i++) - printf("%c %s\n", symbol[i+1], ds[i]->name); + if (!flag_q) { + for (i = 0; i < nds; i++) + printf("%c %s\n", symbol[i+1], ds[i]->name); + } if (!flag_n && !suppress_plot) { SetupPlot(termwidth, flag_s, nds); @@ -675,7 +682,8 @@ PlotSet(ds[i], i + 1); DumpPlot(); } - VitalsHead(); + if (!flag_q) + VitalsHead(); Vitals(ds[0], 1); for (i = 1; i < nds; i++) { Vitals(ds[i], i + 1);