[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.0-29-gb9276c8

Ville Skyttä ville.skytta at iki.fi
Sun Aug 19 10:48:30 UTC 2012


The following commit has been merged in the master branch:
commit b9276c8a374ac5e8cbe7ac814fe3c989f903ddd0
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Aug 19 13:48:20 2012 +0300

    eject: New completion.

diff --git a/completions/Makefile.am b/completions/Makefile.am
index 82bf55d..8d59057 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -75,6 +75,7 @@ bashcomp_DATA = a2x \
 		dumpe2fs \
 		e2freefrag \
 		e2label \
+		eject \
 		eog \
 		ether-wake \
 		evince \
diff --git a/completions/eject b/completions/eject
new file mode 100644
index 0000000..d6b1f6d
--- /dev/null
+++ b/completions/eject
@@ -0,0 +1,30 @@
+# bash completion for eject(1)                             -*- shell-script -*-
+
+_eject()
+{
+    local cur prev words cword
+    _init_completion || return
+
+    case $prev in
+        -h|--help|-V|--version|-c|--changerslot|-x|--cdspeed)
+            return
+            ;;
+        -a|--auto|-i|--manualeject)
+            COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
+            return
+            ;;
+    esac
+
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+        return
+    elif [[ $prev == @(-d|--default) ]]; then
+        return
+    fi
+
+    _cd_devices
+    _dvd_devices
+} &&
+complete -F _eject eject
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/eject.exp b/test/completion/eject.exp
new file mode 100644
index 0000000..5f02e2a
--- /dev/null
+++ b/test/completion/eject.exp
@@ -0,0 +1 @@
+assert_source_completions eject
diff --git a/test/lib/completions/awk.exp b/test/lib/completions/eject.exp
similarity index 79%
copy from test/lib/completions/awk.exp
copy to test/lib/completions/eject.exp
index 260dabc..8de109d 100644
--- a/test/lib/completions/awk.exp
+++ b/test/lib/completions/eject.exp
@@ -11,9 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "awk "
-
-
+assert_complete_any "eject -"
 sync_after_int
 
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list