defaults: Revert to old comparison

Also fix a small bug along the way :)
This commit is contained in:
Noah Gorny
2021-08-15 21:27:59 +03:00
parent de9ea54b81
commit 67eff71d72

View File

@@ -41,8 +41,8 @@ _defaults()
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) ) COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
return 0 return 0
elif [[ "$prev" == "-host" ]]; then elif [[ "$prev" == "-host" ]]; then
return 0
_known_hosts -a _known_hosts -a
return 0
else else
_defaults_domains _defaults_domains
return 0 return 0
@@ -56,7 +56,7 @@ _defaults()
# Both a domain and command have been specified # Both a domain and command have been specified
if [[ ${COMP_WORDS[1]} =~ [${cmds// /|}] ]]; then if [[ ${COMP_WORDS[1]} == [${cmds// /|}] ]]; then
cmd=${COMP_WORDS[1]} cmd=${COMP_WORDS[1]}
domain=${COMP_WORDS[2]} domain=${COMP_WORDS[2]}
key_index=3 key_index=3