aboutsummaryrefslogtreecommitdiff
path: root/completion
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-10-20 22:25:46 -0400
committerDavid Bremner <david@tethera.net>2017-10-21 19:58:32 -0300
commit35456d4b0c89c3fa648fb6a879c5d275e04ff1c2 (patch)
tree428fe3d6976b2a56f8a79318f5aa6d15a01106cd /completion
parent92f318abe40c7e0ef449559728b3a6d160bd9325 (diff)
cli/new: add --try-decrypt=(true|false)
Enable override of the index.try_decrypt setting during "notmuch new" on a per-invocation basis. We update the documentation and tab completion, and also add a test.
Diffstat (limited to 'completion')
-rw-r--r--completion/notmuch-completion.bash13
1 files changed, 11 insertions, 2 deletions
diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index 5201be63..17be6b8f 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -311,11 +311,20 @@ _notmuch_insert()
_notmuch_new()
{
local cur prev words cword split
- _init_completion || return
+ _init_completion -s || return
+
+ $split &&
+ case "${prev}" in
+ --try-decrypt)
+ COMPREPLY=( $( compgen -W "true false" -- "${cur}" ) )
+ return
+ ;;
+ esac
+ ! $split &&
case "${cur}" in
-*)
- local options="--no-hooks --quiet ${_notmuch_shared_options}"
+ local options="--no-hooks --try-decrypt= --quiet ${_notmuch_shared_options}"
compopt -o nospace
COMPREPLY=( $(compgen -W "${options}" -- ${cur}) )
;;