added auto-completion for change-wine
This commit is contained in:
@@ -4,7 +4,7 @@ _winehelper_completions() {
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts="--help --version --debug install installed install-dxvk install-vkd3d -r -i remove-all --clear-pfx killall remove-prefix backup-prefix restore-prefix create-prefix --changelog changelog"
|
||||
opts="--help --version --debug install installed install-dxvk install-vkd3d -r -i remove-all --clear-pfx killall remove-prefix backup-prefix restore-prefix create-prefix --changelog changelog change-wine"
|
||||
wine_cmd="winecfg winereg winefile wineconsole winetricks desktop regedit explorer cmd run"
|
||||
|
||||
case "${prev}" in
|
||||
@@ -34,6 +34,20 @@ _winehelper_completions() {
|
||||
restore-prefix)
|
||||
return 0
|
||||
;;
|
||||
install-dxvk|install-vkd3d)
|
||||
local versions=$(winehelper "${prev}" list 2>/dev/null | grep ' - ' | sed 's/ - //')
|
||||
COMPREPLY=( $(compgen -W "${versions} none list" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
change-wine)
|
||||
local wine_versions=$(awk '
|
||||
/^#+\s*(WINE|WINE_LG|PROTON_LG|PROTON_STEAM)\s*#*$/ { in_group=1 }
|
||||
/^#+/ { if (! ($0 ~ /^#+\s*(WINE|WINE_LG|PROTON_LG|PROTON_STEAM)\s*#*$/)) in_group=0 }
|
||||
/^[a-f0-9]{64}/ && in_group { sub(/\.tar\.xz$/, "", $2); print $2 }
|
||||
' /usr/share/winehelper/sha256sum.list 2>/dev/null)
|
||||
COMPREPLY=( $(compgen -W "system ${wine_versions}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user