From 8e790b26ce1808ab981e48182157f4ac9afd0fa1 Mon Sep 17 00:00:00 2001 From: Thordur Bjornsson Date: Tue, 6 Nov 2012 12:13:55 +0100 Subject: More knobs for knobs. Add a -q knob analogus to the -n knob, but dumps the relative comparisons as well the statistics while suppressing the graph. --- README.md | 1 + ministat.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0543157..9b94bf8 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ The FreeBSD man page is very relevant, pursue it [here](http://www.freebsd.org/c -C : column number to extract (starts and defaults to 1) -d : delimiter(s) string, default to " \t" -n : print summary statistics only, no graph/test + -q : print summary statistics and test only, no graph -s : print avg/median/stddev bars on separate lines -w : width of graph/test output (default 74 or terminal width) diff --git a/ministat.c b/ministat.c index 487c45b..6d65209 100644 --- a/ministat.c +++ b/ministat.c @@ -520,6 +520,7 @@ usage(char const *whine) 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 : print summary statistics and test only, no graph\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); @@ -537,6 +538,7 @@ main(int argc, char **argv) int column = 1; int flag_s = 0; int flag_n = 0; + int flag_q = 0; int termwidth = 74; if (isatty(STDOUT_FILENO)) { @@ -550,7 +552,7 @@ main(int argc, char **argv) } ci = -1; - while ((c = getopt(argc, argv, "C:c:d:snw:")) != -1) + while ((c = getopt(argc, argv, "C:c:d:snqw:")) != -1) switch (c) { case 'C': column = strtol(optarg, &p, 10); @@ -577,6 +579,9 @@ main(int argc, char **argv) case 'n': flag_n = 1; break; + case 'q': + flag_q = 1; + break; case 's': flag_s = 1; break; @@ -610,7 +615,7 @@ main(int argc, char **argv) for (i = 0; i < nds; i++) printf("%c %s\n", symbol[i+1], ds[i]->name); - if (!flag_n) { + if (!flag_n && !flag_q) { SetupPlot(termwidth, flag_s, nds); for (i = 0; i < nds; i++) DimPlot(ds[i]); -- cgit 1.4.1