XADMaster/Extra/unar.bash_completion
2018-12-17 11:28:10 +02:00

23 lines
671 B
Text

__unar()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--output-directory --force-overwrite --force-rename --force-skip \
--force-directory --no-directory --password --encoding \
--password-encoding --indexes --no-recursion --copy-time \
--no-quarantine --forks --quiet --help --version"
if [[ ${prev} == "--forks" ]] ; then
local forksopts
forksopts="fork visible hidden skip"
COMPREPLY=( $(compgen -W "${forksopts}" -- ${cur}) )
return 0
elif [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
}
complete -o bashdefault -A file -F __unar unar