contrib/msearch: add -x for mairix

pull/147/head
Leah Neukirchen 6 years ago
parent fbb797253d
commit 67e0beb56b

@ -3,7 +3,7 @@
MBLAZE=${MBLAZE:-$HOME/.mblaze}
engine=$(mhdr -h search-engine "$MBLAZE/profile")
while getopts nm- opt; do
while getopts nmx- opt; do
case $opt in
n)
engine=notmuch
@ -11,8 +11,11 @@ while getopts nm- opt; do
m)
engine=mu
;;
x)
engine=mairix
;;
'?')
printf "Usage: %s: [-n | -m] query\n" $0
printf "Usage: %s: [-n | -m | -x] query\n" $0
exit 1
;;
-)
@ -31,6 +34,13 @@ case $engine in
mu)
exec mu find --fields l "$@"
;;
mairix)
if [ "$#" -eq 0 ]; then
printf "Usage: %s -x query\n" $0
exit 1
fi
exec mairix -r "$@"
;;
*)
echo "Unsupported search engine: $engine"
exit 1

@ -1,4 +1,4 @@
.Dd September 26, 2018
.Dd September 27, 2018
.Dt MSEARCH 1
.Os
.Sh NAME
@ -6,7 +6,7 @@
.Nd search messages
.Sh SYNOPSIS
.Nm
.Op Fl n | Fl m
.Op Fl n | Fl m | Fl x
.Op Fl -
.Op Ar query
.Sh DESCRIPTION
@ -23,6 +23,9 @@ Search using
.It Fl m
Search using
.Xr mu-find 1 .
.It Fl x
Search using
.Xr mairix 1 .
.It Fl -
Stop scanning for arguments.
.It Ar query
@ -36,7 +39,8 @@ from
.Pa "${MBLAZE:-$HOME/.mblaze}/profile"
is used.
Valid values for this setting are
.Sq notmuch
.Sq notmuch ,
.Sq mairix ,
and
.Sq mu .
If that is unset,
@ -53,8 +57,9 @@ Directory containing mblaze configuration files.
.Ex -std
Note that the called programs may have their own exit values.
.Sh SEE ALSO
.Xr notmuch-search 1 ,
.Xr mairix 1 ,
.Xr mu-find 1 ,
.Xr notmuch-search 1 ,
.Xr mblaze-profile 5
.Sh AUTHORS
.An Thomas Schneider Aq Mt qsx@chaotikum.eu

Loading…
Cancel
Save