Compare commits
4 Commits
00bd907416
...
a2b12327d4
Author | SHA1 | Date | |
---|---|---|---|
a2b12327d4 | |||
b00702c77f | |||
74d8facc08 | |||
0fa3e567ba |
44
auto_completion/bash_completion/winehelper
Normal file
44
auto_completion/bash_completion/winehelper
Normal file
@ -0,0 +1,44 @@
|
||||
# Auto-completion for winhelper
|
||||
_winehelper_completions() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts="--help --version --debug install installed run -r -i remove-all --clear-pfx remove-prefix backup-prefix restore-prefix winecfg winereg winefile wineconsole winetricks killall desktop regedit explorer cmd"
|
||||
|
||||
case "${prev}" in
|
||||
install|-i)
|
||||
if [[ "${COMP_WORDS[COMP_CWORD-2]}" == "install" && "$cur" == "" ]]; then
|
||||
COMPREPLY=( $(compgen -W "list" -- "${cur}") )
|
||||
else
|
||||
local scripts=$(ls /usr/share/winehelper/autoinstall /usr/share/winehelper/manualinstall 2>/dev/null | grep -v '^list$')
|
||||
COMPREPLY=( $(compgen -W "${scripts}" -- "${cur}") )
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
list)
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
;;
|
||||
run)
|
||||
local installed=$(grep -h "Exec=env" ~/.local/share/applications/WineHelper/*.desktop 2>/dev/null | awk -F'"' '{print $4}' | xargs -n1 basename)
|
||||
COMPREPLY=( $(compgen -W "${installed}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
remove-prefix|backup-prefix)
|
||||
local prefixes=$(ls ~/.local/share/winehelper/prefixes 2>/dev/null)
|
||||
COMPREPLY=( $(compgen -W "${prefixes}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
restore-prefix)
|
||||
COMPREPLY=( $(compgen -f -X '!*.whpack' -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
}
|
||||
|
||||
complete -F _winehelper_completions winehelper
|
@ -244,7 +244,7 @@ unpack () {
|
||||
*.tar.gz) command="tar -xhzf" ; outarg="-C " ;;
|
||||
*.tar.zst) command="tar -I zstd -xhf" ; outarg="-C " ;;
|
||||
*.tar) command="tar -xhf" ; outarg="-C " ;;
|
||||
*.zip|*.exe) command="7z x -y" ; outarg="-o" ;;
|
||||
*.zip|*.exe|*.rar) command="7z x -y" ; outarg="-o" ;;
|
||||
esac
|
||||
create_new_dir "$2"
|
||||
if $command "$1" ${outarg}"$2" ; then
|
||||
|
Reference in New Issue
Block a user