From nobody Sun Jan 02 22:52:48 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DD80E1937BEC; Sun, 2 Jan 2022 22:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JRvKX3HtVz3t7Z; Sun, 2 Jan 2022 22:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FD1E1A822; Sun, 2 Jan 2022 22:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 202MqmEN064648; Sun, 2 Jan 2022 22:52:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 202Mqm5B064647; Sun, 2 Jan 2022 22:52:48 GMT (envelope-from git) Date: Sun, 2 Jan 2022 22:52:48 GMT Message-Id: <202201022252.202Mqm5B064647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson Subject: git: 7776d3ccd16e - main - Add a -q flag to ministat to suppress headers in output, for use with -n. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7776d3ccd16ec8fd78db34083eb182c2a2d18e26 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641163968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dy9dH1dFq1xAJ1+J/VvQcSkTBqVo1jG27YSZ7RgB5AI=; b=vrgOVQEzVHNm9lidVuIDd24RqWs4o0YOWwDE3W/PvmMd76WZuSfy5CjVGVNtBLimtSi6ih 4850EDu6GS4Nd47sQ1vUIjhVvmY0NqDg55yyTDpxAwVzaygZu/5meew3OHfO7x5VPgz7n0 PAtifYODOqhdIvVVKJJ2mWWafdIQw5ujFA98rsjVnoli9iOiWQvETvoSjMQISQ+Xi3uA6g UZlVQP7DTxVq8KngYgiS0m3tDhpYd0PZKIqJ7F3BAAOFbdzPfLxJqcHqB6vA916NZ3hhvT lPhCy4ntMmegj8/ecnjops1v3wUR3IUehYLNWXIs+SCmvUYw6Ro9ngbgY2j3Nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641163968; a=rsa-sha256; cv=none; b=yd19mkyOldvybKSmTTlGmoiStIfy3G5ufxoUj7cy6Bs1VuMo+1ZZ0xyCWNOtIwbh4tvLf0 PmgAYuyLrWt+9lS2jN4FvpjaOqtbVg6iVKbm6eFJyAS9TblBqBTMvoOOZvkltMNxk5lxn2 TvgK6Z+CbE8KU3UYFOBvtajI6shTKaIMmAZ19O73k1cPsNPkLjUClu6XSQseYaeKGPLEQT vbZqFjp7o6dNy2YSrDsZ63jB0sVcVt8zSUs0jHknogSq1HZcNKyT7MJuq3kN3mpvKxrMgm ZQXS8hYmKarfjP7yOKHMCDL7dyAKi4nV8uuYt9MSpudEkw2YghtvZ7fsIEs6sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=7776d3ccd16ec8fd78db34083eb182c2a2d18e26 commit 7776d3ccd16ec8fd78db34083eb182c2a2d18e26 Author: Robert Watson AuthorDate: 2021-12-18 20:02:08 +0000 Commit: Robert Watson CommitDate: 2021-12-18 22:53:03 +0000 Add a -q flag to ministat to suppress headers in output, for use with -n. Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D33724 MFC after: 2 weeks --- usr.bin/ministat/ministat.1 | 6 +++++- usr.bin/ministat/ministat.c | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/usr.bin/ministat/ministat.1 b/usr.bin/ministat/ministat.1 index f713baef8fca..c7a20c75ce24 100644 --- 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 @@ 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. +.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 index 3134c4b03928..aa6bc27f89ab 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -533,7 +533,7 @@ usage(char const *whine) 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 @@ 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 : 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 @@ main(int argc, char **argv) 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 @@ main(int argc, char **argv) } 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 @@ main(int argc, char **argv) case 'n': flag_n = 1; break; + case 'q': + flag_q = 1; + break; case 's': flag_s = 1; break; @@ -664,8 +669,10 @@ main(int argc, char **argv) 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 @@ main(int argc, char **argv) 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);