From 67e0beb56b3dc9bea6ca8dd0c390a107e9668768 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 27 Sep 2018 14:08:18 +0200 Subject: [PATCH] contrib/msearch: add -x for mairix --- contrib/msearch | 14 ++++++++++++-- contrib/msearch.1 | 13 +++++++++---- 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