summaryrefslogtreecommitdiffstats
path: root/completion
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2016-12-17 12:50:49 +0200
committerDavid Bremner <david@tethera.net>2017-02-26 07:57:42 -0400
commitc7df0cca9e91c0db7af968e0f434e1a3d602d662 (patch)
tree40af8860a860793eacaa8fd0f12ae6f37fca2444 /completion
parentdf483ed4bd8b7ce6004368860b0130784546bb64 (diff)
completion: add bash completion for query: and property:
Add prefix completion for query and property, with value completion for query. Apparently there's no way to get at the available properties in the cli.
Diffstat (limited to 'completion')
-rw-r--r--completion/notmuch-completion.bash6
1 files changed, 5 insertions, 1 deletions
diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index d44b2a28..7cad047f 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -117,8 +117,12 @@ _notmuch_search_terms()
compopt -o nospace
COMPREPLY=( $(compgen -P "mimetype:" -W "`_notmuch_mimetype ${cur}`" -- ${cur##mimetype:}) )
;;
+ query:*)
+ compopt -o nospace
+ COMPREPLY=( $(compgen -P "query:" -W "`notmuch config list | sed -n '/^query\./s/^query\.\([^=]*\)=.*/\1/p'`" -- ${cur##query:}) )
+ ;;
*)
- local search_terms="from: to: subject: attachment: mimetype: tag: id: thread: folder: path: date: lastmod:"
+ local search_terms="from: to: subject: attachment: mimetype: tag: id: thread: folder: path: date: lastmod: query: property:"
compopt -o nospace
COMPREPLY=( $(compgen -W "${search_terms}" -- ${cur}) )
;;