forked from ftrvxmtrx/split2flac
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsplit2flac-bash-completion.sh
More file actions
executable file
·45 lines (40 loc) · 985 Bytes
/
split2flac-bash-completion.sh
File metadata and controls
executable file
·45 lines (40 loc) · 985 Bytes
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
#!/usr/bin/env bash
_split2flac () {
local cur prev opts formats
_get_comp_words_by_ref cur prev
opts="-p -o -of -cue -cuecharset -nask -f -e -eh -enca -c -nc -C -nC -cs -d -nd -D -nD -F -colors -nocolors -g -ng -s -h -v"
formats="flac m4a mp3 ogg opus wav"
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
else
case "${prev}" in
-o)
_filedir -d
;;
-of|-e|-enca|-C|-cs|-y)
# no completion, wait for user input
;;
-cue)
_filedir cue
;;
-cuecharset)
local available_locales
available_locales=$( iconv -l | sed 's,//,,g' )
COMPREPLY=( $(compgen -W "${available_locales}" -- ${cur}) )
;;
-c)
_filedir
;;
-f)
COMPREPLY=( $(compgen -W "${formats}" -- ${cur}) )
;;
-i)
_filedir
;;
*)
_filedir
;;
esac
fi
}
complete -F _split2flac split2flac