diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2012-01-14 11:40:54 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2012-01-14 11:40:54 +0200 |
commit | 47c49dbfec80c43695e4c95c4cc1e5781c685d93 (patch) | |
tree | 6c31f9329415e1865e770b709aba3021e4e59dee | |
parent | 33883145af5e3290105e2f784f84c7468617d5ee (diff) | |
download | bash-completion-47c49dbfec80c43695e4c95c4cc1e5781c685d93.tar.gz |
rmmod: Add option completions.
-rw-r--r-- | completions/rmmod | 11 | ||||
-rw-r--r-- | test/completion/rmmod.exp | 1 | ||||
-rw-r--r-- | test/lib/completions/rmmod.exp | 18 |
3 files changed, 30 insertions, 0 deletions
diff --git a/completions/rmmod b/completions/rmmod index 3b266067..20d3bfce 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 00000000..040c7372 --- /dev/null +++ b/test/completion/rmmod.exp @@ -0,0 +1 @@ +assert_source_completions rmmod diff --git a/test/lib/completions/rmmod.exp b/test/lib/completions/rmmod.exp new file mode 100644 index 00000000..6c563211 --- /dev/null +++ b/test/lib/completions/rmmod.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "rmmod -" +sync_after_int + + +teardown |