summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-24 21:37:24 -0500
committerJune McEnroe <june@causal.agency>2021-02-24 21:37:24 -0500
commit5d083bea76c36eed0545b634d6ba9be333da2bda (patch)
treeb0f25f343ae1898c3320917b729021214481ceac
parentRemove sbubby, etc. from plan (diff)
downloadsrc-5d083bea76c36eed0545b634d6ba9be333da2bda.tar.gz
src-5d083bea76c36eed0545b634d6ba9be333da2bda.zip
Add -q flag to ever
-rw-r--r--bin/ever.c5
-rw-r--r--bin/man1/ever.16
2 files changed, 8 insertions, 3 deletions
diff --git a/bin/ever.c b/bin/ever.c
index 258b058b..f983912b 100644
--- a/bin/ever.c
+++ b/bin/ever.c
@@ -45,6 +45,7 @@ static int watch(int kq, char *path) {
 	return fd;
 }
 
+static bool quiet;
 static void exec(int fd, char *const argv[]) {
 	pid_t pid = fork();
 	if (pid < 0) err(EX_OSERR, "fork");
@@ -59,6 +60,7 @@ static void exec(int fd, char *const argv[]) {
 	pid = wait(&status);
 	if (pid < 0) err(EX_OSERR, "wait");
 
+	if (quiet) return;
 	if (WIFEXITED(status)) {
 		warnx("exit %d\n", WEXITSTATUS(status));
 	} else if (WIFSIGNALED(status)) {
@@ -71,9 +73,10 @@ static void exec(int fd, char *const argv[]) {
 int main(int argc, char *argv[]) {
 	bool input = false;
 
-	for (int opt; 0 < (opt = getopt(argc, argv, "i"));) {
+	for (int opt; 0 < (opt = getopt(argc, argv, "iq"));) {
 		switch (opt) {
 			break; case 'i': input = true;
+			break; case 'q': quiet = true;
 			break; default:  return EX_USAGE;
 		}
 	}
diff --git a/bin/man1/ever.1 b/bin/man1/ever.1
index 7689c5fb..8cdab99b 100644
--- a/bin/man1/ever.1
+++ b/bin/man1/ever.1
@@ -1,4 +1,4 @@
-.Dd June  1, 2020
+.Dd February 24, 2021
 .Dt EVER 1
 .Os
 .
@@ -8,7 +8,7 @@
 .
 .Sh SYNOPSIS
 .Nm
-.Op Fl i
+.Op Fl iq
 .Ar
 .Ar command
 .Nm
@@ -35,6 +35,8 @@ Attach the
 which was modified
 to the standard input of
 .Ar command .
+.It Fl q
+Suppress exit status output.
 .El
 .
 .Sh EXAMPLES
meter expansion inside inner double quotesHerbert Xu 2018-04-19parser: Fix parsing of ${}Herbert Xu 2018-04-19man: correct typos, iff -> ifMartijn Dekker 2018-04-19expand: Do not quote backslashes in unquoted parameter expansionHerbert Xu 2018-04-19shell: Add subdir-objects to AM_INIT_AUTOMAKEJason Bowen 2018-04-19eval: Restore input files in evalcommandHerbert Xu 2018-04-19eval: Reap zombies after built-in commands and functionsHerbert Xu 2018-04-19redir: Fix typo in noclobber codeHerbert Xu 2018-04-19expand: Fix glibc glob(3) supportHerbert Xu 2018-04-02expand: Fix buffer overflow in expandmetaHerbert Xu 2018-04-02builtin: Move echo space/nl handling into print_escape_strHerbert Xu 2018-04-02builtin: Fix echo performance regressionHerbert Xu 2018-04-02expand: Fix ghost fields with unquoted $@/$*Herbert Xu 2018-04-02parser: Allow newlines within parameter substitutionHerbert Xu 2018-04-02expand: Fix bugs with words connected to the right of $@Herbert Xu 2018-03-25Revert "[BUILTIN] Remove unnecessary restoration of format string in printf"Herbert Xu 2018-03-22parser: Fix backquote support in here-document EOF markHerbert Xu