@ -14,9 +14,9 @@
.Op Ar msgs\ ...
.Op Ar msgs\ ...
.Sh DESCRIPTION
.Sh DESCRIPTION
.Nm
.Nm
prints the messages
prints the names of files from the specified
.Ar msgs
.Ar msgs
where the value of
if the value of
.Ar header
.Ar header
matches the POSIX Extended Regular Expression
matches the POSIX Extended Regular Expression
.Ar regex .
.Ar regex .
@ -25,42 +25,42 @@ If
.Ar header
.Ar header
is empty,
is empty,
.Nm
.Nm
will instead match against the Maildir flags of the messages.
matches against the Maildir flags of
.Ar msgs .
.Pp
.Pp
If
If
.Ar header
.Ar header
is
is
.Sq Cm \& / ,
.Sq Cm \& / ,
.Nm
.Nm
will instead search t he plain text parts of the
searches any plain text parts of the
.Em body
.Ar msgs
of the messages.
.Em body .
.Pp
.Pp
See
See
.Xr mmsg 7
.Xr mmsg 7
for the message argument syntax.
for the message argument syntax.
If no
If no
.Ar msgs
.Ar msgs
are pass ed, and
are specifi ed, and
.Nm
.Nm
is used interactively,
is used interactively,
.Nm
the current sequence will be searched.
will default to the current sequence.
.Pp
.Pp
The options are as follows:
The options are as follows:
.Bl -tag -width Ds
.Bl -tag -width Ds
.It Fl a
.It Fl a
Search for
Search for
.Ar regex
.Ar regex
only in all RFC 2822 address parts in
in RFC 2822 address
.Ar header .
.Ar header
parts only.
.It Fl c
.It Fl c
Don't print matching messages,
Only print a count of matching messages.
just display the number of matched messages.
.It Fl d
.It Fl d
Decode the
Decode the
.Ar header
.Ar header
according to RFC 2047 first .
according to RFC 2047 prior to searching .
.It Fl i
.It Fl i
Match
Match
.Ar regex
.Ar regex
@ -70,7 +70,7 @@ Do not show more than
.Ar max
.Ar max
matches.
matches.
.It Fl o
.It Fl o
Print each match,
Print each match only ,
not the entire line.
not the entire line.
This option is ignored if
This option is ignored if
.Fl c ,
.Fl c ,
@ -79,14 +79,15 @@ or
.Fl v
.Fl v
is specified.
is specified.
.It Fl p
.It Fl p
Print matching messages
Print the file name,
.Ar msgs ,
the header and the matching line
the matching line and the header.
for each of the matched
.Ar msgs .
If
If
.Fl o
.Fl o
is specified each match is printed,
is specified each match is printed,
instead of the matching line.
instead of the matching line.
This option is ignored if the
This option is ignored if
.Fl c ,
.Fl c ,
.Fl q
.Fl q
or
or
@ -96,15 +97,14 @@ is specified.
Quiet mode: do not print anything,
Quiet mode: do not print anything,
quit as soon as possible.
quit as soon as possible.
.It Fl v
.It Fl v
Invert the match, print (or count) all messag es where
Invert the match; print (or count) all fil es where
.Ar regex
.Ar regex
does not match.
does not match.
.El
.El
.Sh EXIT STATUS
.Sh EXIT STATUS
.Nm
.Nm
returns with exit status 0 if a match was found,
exits 0 on success, 1 if no match was found
with exit status 1 if no match was found,
and >1 if an error occurs.
and with exit status higher than 1 if an error occurred.
.Sh SEE ALSO
.Sh SEE ALSO
.Xr grep 1 ,
.Xr grep 1 ,
.Xr mmsg 7 ,
.Xr mmsg 7 ,