summaryrefslogtreecommitdiff
path: root/completions/modprobe
diff options
context:
space:
mode:
Diffstat (limited to 'completions/modprobe')
-rw-r--r--completions/modprobe14
1 files changed, 14 insertions, 0 deletions
diff --git a/completions/modprobe b/completions/modprobe
index cf35f4b9..b59e4dca 100644
--- a/completions/modprobe
+++ b/completions/modprobe
@@ -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