Merge pull request #1913 from Bash-it/ksuther/master

Fixed defaults autocompletion.
pull/1916/head
Noah Gorny 2021-08-12 00:35:13 +03:00 committed by GitHub
commit e321a3d657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ _defaults_domains()
COMPREPLY=() COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]} cur=${COMP_WORDS[COMP_CWORD]}
local domains=$( defaults domains | sed -e 's/, /:/g' | tr : '\n' | sed -e 's/ /\\ /g' | grep -i "^$cur" ) local domains=$( defaults domains | sed -e 's/, /:/g' | tr : '\n' | sed -e 's/ /\\ /g' | grep "^$cur" )
local IFS=$'\n' local IFS=$'\n'
COMPREPLY=( $domains ) COMPREPLY=( $domains )
if [[ $( echo '-app' | grep "^$cur" ) ]]; then if [[ $( echo '-app' | grep "^$cur" ) ]]; then
@ -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