completion: complete notmuch insert --folder to maildir folders only

The --folder option expects a folder relative from maildir root, so
complete like the folder: search term.
This commit is contained in:
Jani Nikula 2015-01-01 16:34:30 +02:00 committed by David Bremner
parent 516a1b37b6
commit 2dfbb7598b

View file

@ -188,7 +188,10 @@ _notmuch_insert()
$split && $split &&
case "${prev}" in case "${prev}" in
--folder) --folder)
_filedir local path=`notmuch config get database.path`
compopt -o nospace
COMPREPLY=( $(compgen -d "$path/${cur}" | \
sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) )
return return
;; ;;
esac esac