unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] completion: add bash completion for "notmuch reindex"
@ 2017-08-09  7:14 Daniel Kahn Gillmor
  2017-08-18 22:56 ` David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Kahn Gillmor @ 2017-08-09  7:14 UTC (permalink / raw)
  To: Notmuch Mail

The main thing that notmuch reindex does is to use search terms, so we
can reuse a bunch of the existing completion framework.
---
 completion/notmuch-completion.bash | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index dd0ec275..440ee3cd 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -417,6 +417,24 @@ _notmuch_search()
     esac
 }
 
+_notmuch_reindex()
+{
+    local cur prev words cword split
+    _init_completion -s || return
+
+    ! $split &&
+    case "${cur}" in
+	-*)
+	    local options="${_notmuch_shared_options}"
+	    compopt -o nospace
+	    COMPREPLY=( $(compgen -W "$options" -- ${cur}) )
+	    ;;
+	*)
+	    _notmuch_search_terms
+	    ;;
+    esac
+}
+
 _notmuch_address()
 {
     local cur prev words cword split
@@ -532,7 +550,7 @@ _notmuch_tag()
 
 _notmuch()
 {
-    local _notmuch_commands="compact config count dump help insert new reply restore search address setup show tag emacs-mua"
+    local _notmuch_commands="compact config count dump help insert new reply restore reindex search address setup show tag emacs-mua"
     local arg cur prev words cword split
 
     # require bash-completion with _init_completion
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] completion: add bash completion for "notmuch reindex"
  2017-08-09  7:14 [PATCH] completion: add bash completion for "notmuch reindex" Daniel Kahn Gillmor
@ 2017-08-18 22:56 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2017-08-18 22:56 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, Notmuch Mail

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

> The main thing that notmuch reindex does is to use search terms, so we
> can reuse a bunch of the existing completion framework.

pushed to master

d

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-18 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09  7:14 [PATCH] completion: add bash completion for "notmuch reindex" Daniel Kahn Gillmor
2017-08-18 22:56 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).