This repository has been archived by the owner on Dec 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbash-completion.bash
84 lines (78 loc) · 2.29 KB
/
bash-completion.bash
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# xbmc-command bash completion
__xbmc-command ()
{
local cur commands comm opt c
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
commands="mute volume play-pause play-music next prev repeat shuffle"
commands="${commands} system youtube twitch slideshow lyrics notification"
commands="${commands} scan wake-on-lan rpc"
opt="--host --port --timeout --help --version"
for c in ${commands}; do
case "${COMP_WORDS[@]}" in
*"$c"*)
comm="$c"
break
;;
esac
done
if [ -z $comm ]; then
COMPREPLY=( $(compgen -W "$commands $opt" -- $cur) )
else
case "$comm" in
mute)
COMPREPLY=( $(compgen -W "yes no toggle --help" -- $cur) )
;;
volume)
COMPREPLY=( $(compgen -W "--help --increment --decrement --set" -- $cur) )
;;
play-pause)
COMPREPLY=( $(compgen -W "--help" -- $cur) )
;;
play-music)
COMPREPLY=( $(compgen -W "--help --artist --album --genre --dry" -- $cur) )
;;
next)
COMPREPLY=( $(compgen -W "--help" -- $cur) )
;;
prev)
COMPREPLY=( $(compgen -W "--help" -- $cur) )
;;
repeat)
COMPREPLY=( $(compgen -W "--help off one all cycle" -- $cur) )
;;
shuffle)
COMPREPLY=( $(compgen -W "--help yes no toggle" -- $cur) )
;;
system)
COMPREPLY=( $(compgen -W "--help quit shutdown reboot suspend hibernate infos" -- $cur) )
;;
youtube)
COMPREPLY=( $(compgen -W "--help --quaility 1080p 720p low" -- $cur) )
;;
twitch)
COMPREPLY=( $(compgen -W "--help --quaility 1080p60 1080p30 720p60 720p30 dialog" -- $cur) )
;;
slideshow)
COMPREPLY=( $(compgen -W "--help --dir --stop" -- $cur) )
;;
lyrics)
COMPREPLY=( $(compgen -W "--help" -- $cur) )
;;
notification)
COMPREPLY=( $(compgen -W "--help --title --message --time" -- $cur) )
;;
scan)
COMPREPLY=( $(compgen -W "--help --audio --video --dir" -- $cur) )
;;
wake-on-lan)
COMPREPLY=( $(compgen -W "--help --port" -- $cur) )
;;
rpc)
COMPREPLY=( $(compgen -W "--help --id" -- $cur) )
;;
esac
fi
}
complete -F __xbmc-command xbmc-command
# vim: ts=2 sts=2 sw=2 et: