Skip to content

Commit

Permalink
rmmod: Add option completions.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Jan 14, 2012
1 parent 3388314 commit 47c49db
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions completions/rmmod
Original file line number Diff line number Diff line change
Expand Up @@ -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
} &&
Expand Down
1 change: 1 addition & 0 deletions test/completion/rmmod.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assert_source_completions rmmod
18 changes: 18 additions & 0 deletions test/lib/completions/rmmod.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
proc setup {} {
save_env
}


proc teardown {} {
assert_env_unmodified
}


setup


assert_complete_any "rmmod -"
sync_after_int


teardown

0 comments on commit 47c49db

Please sign in to comment.