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

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

Loading…
Cancel
Save