mirror of https://github.com/leahneukirchen/mblaze
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.
39 lines
548 B
Plaintext
39 lines
548 B
Plaintext
6 years ago
|
#!/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
|