File: apt-file.bash_completion

package info (click to toggle)
apt-file 2.5.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 608 kB
  • sloc: perl: 1,246; python: 132; makefile: 99; sh: 87
file content (40 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
have apt-file &&
_apt_file()
{
	local cur prev

	COMPREPLY=()
	cur=${COMP_WORDS[COMP_CWORD]}
	prev=${COMP_WORDS[COMP_CWORD-1]}

	case "$prev" in
	list | show)
	    COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) );
	    return 0
	    ;;
	search | find)
	    _filedir
	    return 0
	    ;;
	esac;

	if [[ "$cur" == -* ]]; then

		COMPREPLY=( $( compgen -W '-c -v -V -a -s -l -F -y -H -N -d \
				--cache --verbose --version --architecture \
				--sources-list --package-only --fixed-string \
				--architecture --cdrom-mount --non-interactive \
				--dummy --help' -- $cur ) )
	else

		COMPREPLY=( $( compgen -W 'update search list find \
	                        show purge' -- $cur ) )

	fi


	return 0

}
complete -f -F _apt_file apt-file