X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=contrib%2Fcompletion%2Flei-completion.bash;h=2c28d44a56463ab4e56f71fe02d51ae041e19502;hb=a2415fec470dad7d9848b55af7c156f96dde13e5;hp=67cdd3edf42ff69915181579c72954f830b00c90;hpb=d49c0789d208e66121bfb68ff0c48d7612a7cd8e;p=public-inbox.git
diff --git a/contrib/completion/lei-completion.bash b/contrib/completion/lei-completion.bash
index 67cdd3ed..2c28d44a 100644
--- a/contrib/completion/lei-completion.bash
+++ b/contrib/completion/lei-completion.bash
@@ -1,11 +1,15 @@
-# Copyright (C) 2020 all contributors
+# Copyright (C) 2020-2021 all contributors
# License: AGPL-3.0+
# preliminary bash completion support for lei (Local Email Interface)
# Needs a lot of work, see `lei__complete' in lib/PublicInbox::LEI.pm
_lei() {
- COMPREPLY=($(compgen -W "$(lei _complete ${COMP_WORDS[@]})" \
- -- "${COMP_WORDS[COMP_CWORD]}"))
+ local wordlist="$(lei _complete ${COMP_WORDS[@]})"
+ case $wordlist in
+ *':'* | *'='* | '//'*) compopt -o nospace ;;
+ *) compopt +o nospace ;; # the default
+ esac
+ COMPREPLY=($(compgen -W "$wordlist" -- "${COMP_WORDS[COMP_CWORD]}"))
return 0
}
-complete -o filenames -o bashdefault -F _lei lei
+complete -o default -o bashdefault -F _lei lei