about summary refs log tree commit diff
path: root/contrib/msearch
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/msearch
parentfbb797253d9369abedb3a7abf961ddccce00a0ed (diff)
downloadmblaze-67e0beb56b3dc9bea6ca8dd0c390a107e9668768.tar.gz
mblaze-67e0beb56b3dc9bea6ca8dd0c390a107e9668768.tar.xz
mblaze-67e0beb56b3dc9bea6ca8dd0c390a107e9668768.zip
contrib/msearch: add -x for mairix
Diffstat (limited to 'contrib/msearch')
-rwxr-xr-xcontrib/msearch14
1 files changed, 12 insertions, 2 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