[Bash-completion-commits] [SCM] bash-completion branch, master, updated. e7494cf065d1988db6cefad51cd909214e966ba2

Ville Skyttä ville.skytta at iki.fi
Sat Oct 23 10:10:44 UTC 2010


The following commit has been merged in the master branch:
commit e7494cf065d1988db6cefad51cd909214e966ba2
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Oct 23 13:07:21 2010 +0300

    Add wodim driveropts={varirec,gigarec,tattoofile}= completions.

diff --git a/completions/wodim b/completions/wodim
index 434b806..abc0ff2 100644
--- a/completions/wodim
+++ b/completions/wodim
@@ -27,11 +27,33 @@ _cdrecord()
                     unclose session' -- "$cur" ) )
                 ;;
             driveropts)
-                compopt +o nospace &>/dev/null
-                COMPREPLY=( $( compgen -W 'burnfree noburnfree varirec=
-                    gigarec= audiomaster forcespeed noforcespeed speedread
-                    nospeedread singlesession nosinglesession hidecdr nohidecdr
-                    tattooinfo tattoofile=' -- "$cur" ) )
+                if [[ $cur == *=* ]]; then
+                    prev=${cur%%=*}
+                    cur=${cur#*=}
+                    case $prev in
+                        varirec)
+                            compopt +o nospace &>/dev/null
+                            COMPREPLY=( $( compgen -W "-2 -1 0 1 2" \
+                                -- "$cur" ) )
+                            ;;
+                        gigarec)
+                            compopt +o nospace &>/dev/null
+                            COMPREPLY=( $( compgen -W "0.6 0.7 0.8 1.0 1.2 1.3
+                                1.4" -- "$cur" ) )
+                            ;;
+                        tattoofile)
+                            compopt +o nospace &>/dev/null
+                            _filedir
+                            ;;
+                    esac
+                else
+                    COMPREPLY=( $( compgen -W 'burnfree noburnfree varirec=
+                        gigarec= audiomaster forcespeed noforcespeed speedread
+                        nospeedread singlesession nosinglesession hidecdr
+                        nohidecdr tattooinfo tattoofile=' -- "$cur" ) )
+                    [[ ${#COMPREPLY[@]} == 1 && ${COMPREPLY[0]} != *= ]] && \
+                        compopt +o nospace &>/dev/null
+                fi
                 ;;
             driver)
                 compopt +o nospace &>/dev/null

-- 
bash-completion



More information about the Bash-completion-commits mailing list