[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-136-gd02b4e1

Ville Skyttä ville.skytta at iki.fi
Sat Jan 14 09:44:35 UTC 2012


The following commit has been merged in the master branch:
commit 47c49dbfec80c43695e4c95c4cc1e5781c685d93
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Jan 14 11:40:54 2012 +0200

    rmmod: Add option completions.

diff --git a/completions/rmmod b/completions/rmmod
index 3b26606..20d3bfc 100644
--- a/completions/rmmod
+++ b/completions/rmmod
@@ -6,6 +6,17 @@ _rmmod()
     local cur prev words cword
     _init_completion || return
 
+    case $prev in
+        -h|--help|-V|--version)
+            return
+            ;;
+    esac
+
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+        return
+    fi
+
     _installed_modules "$cur"
     return 0
 } &&
diff --git a/test/completion/rmmod.exp b/test/completion/rmmod.exp
new file mode 100644
index 0000000..040c737
--- /dev/null
+++ b/test/completion/rmmod.exp
@@ -0,0 +1 @@
+assert_source_completions rmmod
diff --git a/test/lib/completions/bc.exp b/test/lib/completions/rmmod.exp
similarity index 79%
copy from test/lib/completions/bc.exp
copy to test/lib/completions/rmmod.exp
index 23c22b6..6c56321 100644
--- a/test/lib/completions/bc.exp
+++ b/test/lib/completions/rmmod.exp
@@ -11,9 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "bc --"
-
-
+assert_complete_any "rmmod -"
 sync_after_int
 
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list