aboutsummaryrefslogtreecommitdiff
path: root/system/unar/Extra/unar.bash_completion
blob: 06fe66f56752103d7b26489d9c000a91851ebe2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
__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