summaryrefslogtreecommitdiffstats
path: root/completions/wodim
diff options
context:
space:
mode:
Diffstat (limited to 'completions/wodim')
-rw-r--r--completions/wodim47
1 files changed, 23 insertions, 24 deletions
diff --git a/completions/wodim b/completions/wodim
index b308291..095fa0d 100644
--- a/completions/wodim
+++ b/completions/wodim
@@ -1,9 +1,9 @@
# bash completion for cdrecord/wodim -*- shell-script -*-
-_cdrecord()
+_comp_cmd_wodim()
{
- local cur prev words cword
- _init_completion -n = || return
+ local cur prev words cword comp_args
+ _comp_initialize -n = -- "$@" || return
local generic_options track_options track_mode
@@ -13,11 +13,11 @@ _cdrecord()
cur=${cur#*=}
case $prev in
textfile | cuefile | msifile)
- _filedir
+ _comp_compgen_filedir
;;
blank)
- COMPREPLY=($(compgen -W 'help all fast track unreserve trtail
- unclose session' -- "$cur"))
+ _comp_compgen -- -W 'help all fast track unreserve trtail
+ unclose session'
;;
driveropts)
if [[ $cur == *=* ]]; then
@@ -25,30 +25,29 @@ _cdrecord()
cur=${cur#*=}
case $prev in
varirec)
- COMPREPLY=($(compgen -W "-2 -1 0 1 2" -- "$cur"))
+ _comp_compgen -- -W "-2 -1 0 1 2"
;;
gigarec)
- COMPREPLY=($(compgen -W "0.6 0.7 0.8 1.0 1.2 1.3
- 1.4" -- "$cur"))
+ _comp_compgen -- -W "0.6 0.7 0.8 1.0 1.2 1.3 1.4"
;;
tattoofile)
- _filedir
+ _comp_compgen_filedir
;;
esac
else
- COMPREPLY=($(compgen -W 'burnfree noburnfree varirec=
- gigarec= audiomaster forcespeed noforcespeed speedread
+ _comp_compgen -- -W 'burnfree noburnfree varirec= gigarec=
+ audiomaster forcespeed noforcespeed speedread
nospeedread singlesession nosinglesession hidecdr
- nohidecdr tattooinfo tattoofile=' -- "$cur"))
+ nohidecdr tattooinfo tattoofile='
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
fi
;;
driver)
- COMPREPLY=($(compgen -W "$($1 driver=help 2>&1 |
- awk 'NR > 1 { print $1 }') help" -- "$cur"))
+ _comp_compgen_split -- "$("$1" driver=help 2>&1 |
+ _comp_awk 'NR > 1 { print $1 }') help"
;;
minbuf)
- COMPREPLY=($(compgen -W '{25..95}' -- "$cur"))
+ _comp_compgen -- -W '{25..95}'
;;
esac
return
@@ -66,15 +65,15 @@ _cdrecord()
-isosize -pad -nopad -shorttrack -noshorttrack -preemp -nopreemp
-copy -nocopy -scms "isrc=" "index=" "padsize=" "pregap=" "tsize=")
# look if previous was either a file or a track option
- track_mode=0
+ track_mode=""
if ((cword > 1)); then
if [[ -f $prev ]]; then
- track_mode=1
+ track_mode=set
else
local opt
for opt in "${track_options[@]}"; do
if [[ $opt == "$prev" ]]; then
- track_mode=1
+ track_mode=set
break
fi
done
@@ -82,15 +81,15 @@ _cdrecord()
fi
# files are always eligible completion
- _filedir
+ _comp_compgen_filedir
# track options are always available
- COMPREPLY+=($(compgen -W '${track_options[@]}' -- "$cur"))
+ _comp_compgen -a -- -W '"${track_options[@]}"'
# general options are no more available after file or track option
- if ((track_mode == 0)); then
- COMPREPLY+=($(compgen -W '${generic_options[@]}' -- "$cur"))
+ if [[ ! $track_mode ]]; then
+ _comp_compgen -a -- -W '"${generic_options[@]}"'
fi
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
} &&
- complete -F _cdrecord cdrecord wodim
+ complete -F _comp_cmd_wodim wodim cdrecord
# ex: filetype=sh