completion: complete notmuch insert --folder to maildir folders only
authorJani Nikula <jani@nikula.org>
Thu, 1 Jan 2015 14:34:30 +0000 (16:34 +0200)
committerDavid Bremner <david@tethera.net>
Fri, 2 Jan 2015 15:51:00 +0000 (16:51 +0100)
The --folder option expects a folder relative from maildir root, so
complete like the folder: search term.

completion/notmuch-completion.bash

index 386437333742cbc887d92a851d37a2a438d6b684..d58dc8bed60f3640529d0b06dd5e294308acbfae 100644 (file)
@@ -188,7 +188,10 @@ _notmuch_insert()
     $split &&
     case "${prev}" in
        --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
            ;;
     esac