Skip to content

Commit

Permalink
modprobe: Don't suggest installing already installed modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Jan 29, 2013
1 parent c4cc3eb commit d08b9f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions completions/modprobe
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ _modprobe()
-p "$module" 2>/dev/null | cut -d: -f1 )" -- "$cur" ) )
else
_modules $version
if [[ $COMPREPLY ]]; then
# filter out already installed modules
local -a mods=( "${COMPREPLY[@]}" )
_installed_modules "$cur"
for i in ${!mods[@]}; do
for module in ${COMPREPLY[@]}; do
if [[ ${mods[i]} == $module ]]; then
unset mods[i]
break
fi
done
done
COMPREPLY=( "${mods[@]}" )
fi
fi
;;
esac
Expand Down

0 comments on commit d08b9f2

Please sign in to comment.