forked from CastroFidel/winehelper
		
	added auto-completion for installing dxvk/vkd3d
This commit is contained in:
		| @@ -4,7 +4,7 @@ _winehelper_completions() { | |||||||
|     COMPREPLY=() |     COMPREPLY=() | ||||||
|     cur="${COMP_WORDS[COMP_CWORD]}" |     cur="${COMP_WORDS[COMP_CWORD]}" | ||||||
|     prev="${COMP_WORDS[COMP_CWORD-1]}" |     prev="${COMP_WORDS[COMP_CWORD-1]}" | ||||||
|     opts="--help --version --debug install installed -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" | ||||||
|     wine_cmd="winecfg winereg winefile wineconsole winetricks desktop regedit explorer cmd run" |     wine_cmd="winecfg winereg winefile wineconsole winetricks desktop regedit explorer cmd run" | ||||||
|  |  | ||||||
|     case "${prev}" in |     case "${prev}" in | ||||||
|   | |||||||
| @@ -8,6 +8,8 @@ _winehelper() { | |||||||
|     '--version[Показать информацию о пакете и его версии]' |     '--version[Показать информацию о пакете и его версии]' | ||||||
|     '--debug[Режим отладки]' |     '--debug[Режим отладки]' | ||||||
|     'install[Запустить скрипт установки программы]' |     'install[Запустить скрипт установки программы]' | ||||||
|  |     'install-dxvk[Установить/удалить DXVK]' | ||||||
|  |     'install-vkd3d[Установить/удалить VKD3D]' | ||||||
|     'installed[Список установленных программ]' |     'installed[Список установленных программ]' | ||||||
|     '-r[Запуск программы (отладка)]' |     '-r[Запуск программы (отладка)]' | ||||||
|     '-i[Запустить скрипт установки программы]' |     '-i[Запустить скрипт установки программы]' | ||||||
| @@ -61,6 +63,12 @@ _winehelper() { | |||||||
|         restore-prefix) |         restore-prefix) | ||||||
|           _files |           _files | ||||||
|           ;; |           ;; | ||||||
|  |         install-dxvk) | ||||||
|  |           _get_component_versions 'install-dxvk' | ||||||
|  |           ;; | ||||||
|  |         install-vkd3d) | ||||||
|  |           _get_component_versions 'install-vkd3d' | ||||||
|  |           ;; | ||||||
|         *) |         *) | ||||||
|           _values 'winehelper options' "${opts[@]}" "${wine_cmd[@]}" |           _values 'winehelper options' "${opts[@]}" "${wine_cmd[@]}" | ||||||
|           ;; |           ;; | ||||||
| @@ -69,6 +77,16 @@ _winehelper() { | |||||||
|   esac |   esac | ||||||
| } | } | ||||||
|  |  | ||||||
|  | _get_component_versions () { | ||||||
|  |   local component_command=$1 | ||||||
|  |   local -a versions | ||||||
|  |  | ||||||
|  |   versions=( ${(f)"$(winehelper "${component_command}" list 2>/dev/null | grep ' - ' | sed 's/ - //')" } ) | ||||||
|  |   versions+=(none list) | ||||||
|  |  | ||||||
|  |   _values 'versions' "${versions[@]}" | ||||||
|  | } | ||||||
|  |  | ||||||
| _get_prefixes () { | _get_prefixes () { | ||||||
|   prefixes=( ${(f)"$(ls -1 ~/.local/share/winehelper/prefixes 2>/dev/null)"} ) |   prefixes=( ${(f)"$(ls -1 ~/.local/share/winehelper/prefixes 2>/dev/null)"} ) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user