From: Jani Nikula Date: Thu, 1 Jan 2015 14:34:30 +0000 (+0200) Subject: completion: complete notmuch insert --folder to maildir folders only X-Git-Tag: 0.20~106 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=2dfbb7598b6869511c5d654221664bc9b2230413 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. --- diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash index 38643733..d58dc8be 100644 --- a/completion/notmuch-completion.bash +++ b/completion/notmuch-completion.bash @@ -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