-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathmpc.sh
39 lines (31 loc) · 828 Bytes
/
mpc.sh
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
_patch_help() {
if [[ $# -eq 1 ]]; then
$@ help | sed '/^Commands:/,/^\s*$/ {s/^ mpc / /;s/output # or //;}'
else
$1 help | \
sed -n "s/^ $1 $2 \(.*\)/Usage: $1 $2 \1/p" | \
sed \
-e 's/ \+.*//' \
-e 's/<on|once|off>/{on|once|off}/' \
-e 's/<on|off>/{on|off}/' \
fi
}
_patch_table() {
if [[ "$*" == "mpc" ]]; then
_patch_table_add_metadata inherit-flag-options
elif [[ "$*" == "mpc add" ]] \
|| [[ "$*" == "mpc insert" ]] \
; then
_patch_table_edit_arguments 'uri;[`_choice_song`]'
elif [[ "$*" == "mpc playlist" ]]; then
_patch_table_edit_arguments 'playlist;[`_choice_playlist`]'
else
cat
fi
}
_choice_song() {
mpc listall
}
_choice_playlist() {
mpc lsplaylists
}