about summary refs log tree commit diff
path: root/contrib
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-09-27 14:08:18 +0200
committerLeah Neukirchen <leah@vuxu.org>2018-09-27 14:10:35 +0200
commit67e0beb56b3dc9bea6ca8dd0c390a107e9668768 (patch)
treedca8803f027d67e0815122fa5900904f1e9ae909 /contrib
parentfbb797253d9369abedb3a7abf961ddccce00a0ed (diff)
downloadmblaze-67e0beb56b3dc9bea6ca8dd0c390a107e9668768.tar.gz
mblaze-67e0beb56b3dc9bea6ca8dd0c390a107e9668768.tar.xz
mblaze-67e0beb56b3dc9bea6ca8dd0c390a107e9668768.zip
contrib/msearch: add -x for mairix
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/msearch14
-rw-r--r--contrib/msearch.113
2 files changed, 21 insertions, 6 deletions
diff --git a/contrib/msearch b/contrib/msearch
index bab0616..6272512 100755
--- a/contrib/msearch
+++ b/contrib/msearch
@@ -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
diff --git a/contrib/msearch.1 b/contrib/msearch.1
index 67bd630..c2c7fd5 100644
--- a/contrib/msearch.1
+++ b/contrib/msearch.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