about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--man/mpick.13
-rw-r--r--mpick.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/man/mpick.1 b/man/mpick.1
index 69a8e41..89bf619 100644
--- a/man/mpick.1
+++ b/man/mpick.1
@@ -7,6 +7,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl T
+.Op Fl v
 .Op Fl t Ar test
 .Op Ar msglist\ ...
 .Sh DESCRIPTION
@@ -29,6 +30,8 @@ Only show messages matching the expression
 .Ar test ,
 see
 .Sx TESTS .
+.It Fl v
+Print how many messages were tested and picked to standard error.
 .El
 .Sh MSGLISTS
 .Nm
diff --git a/mpick.c b/mpick.c
index d15d1d4..ca0fa84 100644
--- a/mpick.c
+++ b/mpick.c
@@ -1142,15 +1142,18 @@ main(int argc, char *argv[])
 {
 	long i;
 	int c;
+	int vflag;
 
 	argv0 = argv[0];
 	now = time(0);
 	num = 1;
+	vflag = 0;
 
-	while ((c = getopt(argc, argv, "Tt:")) != -1)
+	while ((c = getopt(argc, argv, "Tt:v")) != -1)
 		switch (c) {
 		case 'T': Tflag = need_thr = 1; break;
 		case 't': expr = chain(expr, EXPR_AND, parse_expr(optarg)); break;
+		case 'v': vflag = 1; break;
 		default:
 			fprintf(stderr, "Usage: %s [-T] [-t test] [msglist ...]\n", argv0);
 			exit(1);
@@ -1169,6 +1172,7 @@ main(int argc, char *argv[])
 	if (Tflag && thr)
 		do_thr();
 
-	fprintf(stderr, "%ld mails tested, %ld picked.\n", i, kept);
+	if (vflag)
+		fprintf(stderr, "%ld mails tested, %ld picked.\n", i, kept);
 	return 0;
 }