File: completion

package info (click to toggle)
moosic 1.5.4-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 796 kB
  • ctags: 576
  • sloc: python: 3,360; makefile: 61
file content (46 lines) | stat: -rw-r--r-- 1,498 bytes parent folder | download | duplicates (4)
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
41
42
43
44
45
46
# moosic(1) completion
# 
# Copyright 2003 "Etienne PIERRE" <etienne@tuxfamily.org>
#
have moosic &&
_moosic()
{
	local cur options paroptions

	COMPREPLY=()
	cur=${COMP_WORDS[COMP_CWORD]}
	prev=${COMP_WORDS[COMP_CWORD-1]}
	
        options='-d --shuffle-dir -a --shuffle-args -g --shuffle-global -o \
                --inorder -s --sort -i --ignore-case -r --no-recurse -n \
                --non-file-args -f --auto-find -F --auto-grep -m --music-dir \
                -c --config-dir -t --tcp -N --no-startserver -S --showcommands \
                -h --help -v --version'
        commands='add append clear crop curr current cut del die exit filter \
                hist history insert len length list loop mixin move next \
                noloop noplay partial-sort pause pl-add plainlist pl-append \
                play pl-insert pl-mixin pl-prepend pre prepend prev previous \
                putback quit reconfig reconfigure remove reshuffle reverse \
                showconfig shuffle sleep sort stagger stagger-add \
                stagger-merge state status stop sub suball toggle-loop \
                toggle-pause unpause version wake wipe'
	paroptions="$options $commands"
	
	if [ ${COMP_CWORD} -eq 1 ]; then
	    COMPREPLY=($( compgen -W "$paroptions" | grep ^$cur ))
	else
	    case "$prev" in
		-*)
		    COMPREPLY=($( compgen -W "$paroptions" | grep ^$cur ))
		;;
		*)
		    _filedir
		;;
	    esac
	fi

	return 0

}
[ "$have" ] && complete -F _moosic -o filenames moosic