Fix Bash completion space regression (#12828)

This commit is contained in:
Xubai Wang 2025-02-11 00:42:45 +08:00 committed by GitHub
parent fcfa70e66c
commit ff012e844f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,23 +9,23 @@ _hx() {
case "$prev" in case "$prev" in
-g | --grammar) -g | --grammar)
COMPREPLY=($(compgen -W 'fetch build' -- "$cur")) mapfile -t COMPREPLY < <(compgen -W 'fetch build' -- "$cur")
return 0 return 0
;; ;;
--health) --health)
languages=$(hx --health | tail -n '+7' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g') 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 return 0
;; ;;
esac esac
case "$2" in 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 return 0
;; ;;
*) *)
COMPREPLY=($(compgen -fd -- """$2""")) mapfile -t COMPREPLY < <(compgen -fd -- """$2""")
return 0 return 0
;; ;;
esac esac