From ff012e844fe3726190b41fa47c432503d9909e65 Mon Sep 17 00:00:00 2001 From: Xubai Wang <18016038327@189.cn> Date: Tue, 11 Feb 2025 00:42:45 +0800 Subject: [PATCH] Fix Bash completion space regression (#12828) --- contrib/completion/hx.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/completion/hx.bash b/contrib/completion/hx.bash index 1b102017..37893bf5 100644 --- a/contrib/completion/hx.bash +++ b/contrib/completion/hx.bash @@ -9,23 +9,23 @@ _hx() { case "$prev" in -g | --grammar) - COMPREPLY=($(compgen -W 'fetch build' -- "$cur")) + mapfile -t COMPREPLY < <(compgen -W 'fetch build' -- "$cur") return 0 ;; --health) languages=$(hx --health | tail -n '+7' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g') - COMPREPLY=($(compgen -W """$languages""" -- "$cur")) + mapfile -t COMPREPLY < <(compgen -W """$languages""" -- "$cur") return 0 ;; esac case "$2" in -*) - COMPREPLY=($(compgen -W "-h --help --tutor -V --version -v -vv -vvv --health -g --grammar --vsplit --hsplit -c --config --log" -- """$2""")) + mapfile -t COMPREPLY < <(compgen -W "-h --help --tutor -V --version -v -vv -vvv --health -g --grammar --vsplit --hsplit -c --config --log" -- """$2""") return 0 ;; *) - COMPREPLY=($(compgen -fd -- """$2""")) + mapfile -t COMPREPLY < <(compgen -fd -- """$2""") return 0 ;; esac