History

Add bash completion config file

Anton Larionov committed 13 years ago

Commit 380f6ff1 parent 74872a91 file · +42 −0Browse files

Unified · Split

split2flac-bash-completion.sh+42−0
@@ -0,0 +1,42 @@
1#!/usr/bin/env bash
2
3_split2flac () {
4 local cur prev opts formats
5
6 _get_comp_words_by_ref cur prev
7
8 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"
9 formats="flac m4a mp3 ogg wav"
10
11 if [[ ${cur} == -* ]] ; then
12 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
13 else
14 case "${prev}" in
15 -o)
16 _filedir -d
17 ;;
18 -of|-e|-enca|-C|-cs)
19 # no completion, wait for user input
20 ;;
21 -cue)
22 _filedir cue
23 ;;
24 -cuecharset)
25 local available_locales
26 available_locales=$( iconv -l | sed 's,//,,g' )
27 COMPREPLY=( $(compgen -W "${available_locales}" -- ${cur}) )
28 ;;
29 -c)
30 _filedir
31 ;;
32 -f)
33 COMPREPLY=( $(compgen -W "${formats}" -- ${cur}) )
34 ;;
35 *)
36 _filedir
37 ;;
38 esac
39 fi
40}
41
42complete -F _split2flac split2flac

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t