diff options
author | Jani Nikula <jani@nikula.org> | 2014-03-12 22:33:48 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-03-25 20:00:13 -0300 |
commit | d5822224da58b93f1c3851a149c2f787acd9c401 (patch) | |
tree | bf288b261ed66752ef3a69a42a6aa27f88d5842d | |
parent | 92c3fd938e7a4e86edbc872eb5348dc048ec0e78 (diff) |
completion: add proper completion of folder: and path:
Complete folder: to maildir folders and path: to directories in mail
store.
-rw-r--r-- | completion/notmuch-completion.bash | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash index 0f132043..59f1a3ea 100644 --- a/completion/notmuch-completion.bash +++ b/completion/notmuch-completion.bash @@ -49,8 +49,19 @@ _notmuch_search_terms() from:*) COMPREPLY=( $(compgen -P "from:" -W "`_notmuch_user_emails`" -- ${cur##from:}) ) ;; + path:*) + local path=`notmuch config get database.path` + compopt -o nospace + COMPREPLY=( $(compgen -d "$path/${cur##path:}" | sed "s|^$path/||" ) ) + ;; + folder:*) + local path=`notmuch config get database.path` + compopt -o nospace + COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \ + sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) ) + ;; *) - local search_terms="from: to: subject: attachment: tag: id: thread: folder: date:" + local search_terms="from: to: subject: attachment: tag: id: thread: folder: path: date:" compopt -o nospace COMPREPLY=( $(compgen -W "${search_terms}" -- ${cur}) ) ;; |