diff --git a/profile.d/bash-completion/git-completion.sh b/profile.d/bash-completion/git-completion.sh index ff0477e..a7ef79a 100644 --- a/profile.d/bash-completion/git-completion.sh +++ b/profile.d/bash-completion/git-completion.sh @@ -40,7 +40,7 @@ _profile_git_complete_remotes() return 0 fi - COMPREPLY=( $(compgen -W "$(git remote 2>/dev/null)" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "$(git remote 2>/dev/null)" -- "$cur") } _profile_git_complete_refs() @@ -53,7 +53,7 @@ _profile_git_complete_refs() return 0 fi - COMPREPLY=( $(compgen -W "$(git for-each-ref --format='%(refname:short)' refs/heads refs/remotes refs/tags 2>/dev/null)" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "$(git for-each-ref --format='%(refname:short)' refs/heads refs/remotes refs/tags 2>/dev/null)" -- "$cur") } _profile_git_complete_add_paths() @@ -85,7 +85,7 @@ _profile_git_complete_add_paths() return 0 fi - COMPREPLY=( $(compgen -f -- "${COMP_WORDS[COMP_CWORD]}") ) + mapfile -t COMPREPLY < <(compgen -f -- "${COMP_WORDS[COMP_CWORD]}") } _complete_gst() @@ -95,10 +95,10 @@ _complete_gst() case "$cur" in -*) - COMPREPLY=( $(compgen -W "-h --help" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help" -- "$cur") ;; *) - COMPREPLY=( $(compgen -d -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -d -- "$cur") ;; esac } @@ -116,7 +116,7 @@ _complete_ggraph() ;; esac - COMPREPLY=( $(compgen -W "-h --help -n --limit" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help -n --limit" -- "$cur") } _complete_gsync() @@ -125,7 +125,7 @@ _complete_gsync() cur="${COMP_WORDS[COMP_CWORD]}" if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W "-h --help" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help" -- "$cur") return 0 fi @@ -146,7 +146,7 @@ _complete_gacp() esac if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W "-h --help -a --auto -m --message" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help -a --auto -m --message" -- "$cur") return 0 fi @@ -159,7 +159,7 @@ _complete_greset() cur="${COMP_WORDS[COMP_CWORD]}" if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W "-h --help -x --with-ignored" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help -x --with-ignored" -- "$cur") return 0 fi @@ -172,7 +172,7 @@ _complete_gwip() cur="${COMP_WORDS[COMP_CWORD]}" if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W "-h --help" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help" -- "$cur") else COMPREPLY=() fi @@ -184,7 +184,7 @@ _complete_gprune() cur="${COMP_WORDS[COMP_CWORD]}" if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W "-h --help" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help" -- "$cur") return 0 fi @@ -196,7 +196,7 @@ _complete_groot() local cur cur="${COMP_WORDS[COMP_CWORD]}" - COMPREPLY=( $(compgen -W "-h --help -g --go" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help -g --go" -- "$cur") } _profile_git_register_completions() diff --git a/profile.d/bash-completion/prompt-completion.sh b/profile.d/bash-completion/prompt-completion.sh index 513b584..fce66aa 100755 --- a/profile.d/bash-completion/prompt-completion.sh +++ b/profile.d/bash-completion/prompt-completion.sh @@ -35,16 +35,16 @@ _complete_set_theme() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W "-h --help -l --list -p --preview -S --save" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "-h --help -l --list -p --preview -S --save" -- "$cur") return 0 fi if [[ "$cur" == */* || "$cur" == .* ]]; then - COMPREPLY=( $(compgen -f -X '!*.theme' -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -f -X '!*.theme' -- "$cur") return 0 fi - COMPREPLY=( $(compgen -W "$(_profile_prompt_complete_theme_names)" -- "$cur") ) + mapfile -t COMPREPLY < <(compgen -W "$(_profile_prompt_complete_theme_names)" -- "$cur") } if [[ $- == *i* && -n ${BASH_VERSION:-} ]]; then