-.\" Manpage for nuseradd.
-.\" Contact vivek@nixcraft.net.in to correct errors or typos.
-.TH fag 1 "07 February 2017" "1.0" "User Commands"
+.TH fag 1 "12 August 2017" "1.0" "User Commands"
.hy 0
.SH NAME
fag \- daemonize program after a string was found (ForkAfterGrep)
.br
.SH DESCRIPTION
.B fag
-searches the
+uses
+.B grep
+to search the output of
.IR PROGRAM
-for the string
-.IR PATTERN .
-This is useful if a program takes a while to initialize and prints a message to stdout or stderr when ready. When placed in a script,
-.B fag
-blocks execution until the pattern was found, then daemonizes the child process, returns the PID on stdout and exits.
+for the regular expression
+.IR PATTERN
+and daemonizes it when a match is found. The PID is then returned on stdout.
.SH OPTIONS
.SS "Behaviour Changing Options"
.TP
.BR stderr
instead of
.BR stdout .
+.TP
+.BR \-V
+Be verbose; print program's
+.BR stdout
+(or stderr if
+.BR \-e
+is set) to stderr.
.SS "Generic Program Information"
.TP
.B \-h
if the error occured from within
.B fag
or in case the chid process exits prematurely, its exit code is inherited. Notably, \fI69\fP is returned when the timeout is reached.
-.\".RS
-.\".IP *
-.\"EX_OK (0): successful termination
-.\".IP *
-.\"EX_UNAVAILABLE (69): PROGRAM timed out
-.\".IP *
-.\"EX_USAGE (64): command was used incorrectly (argument error)
-.\".IP *
-.\"EX_OSERR (71): system error (can't fork, pipe, etc.)
-.\".IP *
-.\"EX_IOERR (74): input/output error (e.g. can't read)
-.\".RE
.SH BUGS
.SS Known Bugs
-Only a simple string search is performed on
-.IR PATTERN
-in this version.
-.PP
-If a
-.IR PROGRAM
-like
-.BR cat
-opens stdout/stderr, but never writes to it, the timeout isn't triggered.
-.PP
-.IR SIGNAL
-needs to be given as an integer; mnemonic should be supported in the future.
+if grep exits with a code > 0, fag should terminate with grep's exit code and an error message. instead, fag exits as if a match was found.
.PP
Sometimes, stdin behaves strange after the program terminates.
.SS Reporting Bugs
Please report bugs and patches to the issue tracker at https://github.com/girst/forkaftergrep/.
.SH NOTES
-Some might find the name of this program offensive. Feel free to create a symlink or alias on your system.
+.IR SIGNAL
+needs to be given as an integer. implementing mnemonics is dirty and not very portable; maybe support in the future.
.SH COPYRIGHT
Copyright 2017 Tobias Girstmair. This is free software; see https://www.gnu.org/licenses/gpl-3.0.html for conditions.
.SH AUTHOR