From: girst Date: Thu, 27 Jul 2017 19:08:29 +0000 (+0200) Subject: add verbose mode; fix makefile X-Git-Url: https://git.gir.st/forkaftergrep.git/commitdiff_plain/e6cd2fbbd6805765decbfe2c6faf20c39c7980ff add verbose mode; fix makefile --- e6cd2fbbd6805765decbfe2c6faf20c39c7980ff diff --cc fag.c index aed1836,1cfde0a..cbe811c --- a/fag.c +++ b/fag.c @@@ -136,9 -132,6 +136,9 @@@ int fork_after_grep (struct opt opts) } return EX_UNAVAILABLE; } - if (op.verbose) { ++ if (opts.verbose) { + fputs (buf, opts.stream==STDERR_FILENO?stderr:stdout); + } if (strstr (buf, opts.pattern) != NULL) { printf ("%d\n", cpid); /* create a new child to keep pipe alive (will exit with exec'd program) */