You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mblaze/contrib/msearch

39 lines
548 B
Bash

#!/bin/sh
MBLAZE=${MBLAZE:-$HOME/.mblaze}
engine=$(mhdr -h search-engine "$MBLAZE/profile")
while getopts nm- opt; do
case $opt in
n)
engine=notmuch
;;
m)
engine=mu
;;
'?')
printf "Usage: %s: [-n | -m] query\n" $0
exit 1
;;
-)
break
;;
esac
done
shift $(($OPTIND - 1))
[ -z "$engine" ] && engine=notmuch
case $engine in
notmuch)
exec notmuch search --output=files "$@"
;;
mu)
exec mu find --fields l "$@"
;;
*)
echo "Unsupported search engine: $engine"
exit 1
;;
esac