summaryrefslogtreecommitdiffstats
path: root/completion
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2015-01-01 16:34:30 +0200
committerDavid Bremner <david@tethera.net>2015-01-02 16:51:00 +0100
commit2dfbb7598b6869511c5d654221664bc9b2230413 (patch)
tree47aa0ed294c3d5edad2418de240a6135260b338b /completion
parent516a1b37b6a5c1c8bf7b262250e14290513bb0ba (diff)
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.
Diffstat (limited to 'completion')
-rw-r--r--completion/notmuch-completion.bash5
1 files changed, 4 insertions, 1 deletions
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