aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions/modprobe.fish
diff options
context:
space:
mode:
authorGravatar Josef Gajdusek <atx@atx.name>2016-03-28 00:39:15 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-03-28 14:38:19 +0200
commit0eb3fd6b3f25e6fd0f22ed4327b2aa1b019cde18 (patch)
treec369a8442fdcd019cfe2eae163fb84020e1b2d70 /share/completions/modprobe.fish
parent6663c73eb0f1eedf5290bf07398d6dbe30eaaf73 (diff)
Make modprobe completion more precise
Only match loaded modules when -r is specified. Also adds /lib/modules/(uname -r)/misc to the search path. This directory is used by Gentoo for package-provided modules (such as the app-emulation/virtualbox-modules)
Diffstat (limited to 'share/completions/modprobe.fish')
-rw-r--r--share/completions/modprobe.fish3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/completions/modprobe.fish b/share/completions/modprobe.fish
index 14133ad5..8075d437 100644
--- a/share/completions/modprobe.fish
+++ b/share/completions/modprobe.fish
@@ -2,7 +2,8 @@
# Completions for the modprobe command
#
-complete -c modprobe --no-files -d Module -a "(find /lib/modules/(uname -r)/kernel -type f | sed -e 's/\/.*\/\([^\/.]*\).*/\1/')"
+complete -c modprobe -n "__fish_contains_opt -s r remove" --no-files -d Module -a "(lsmod | cut -d' ' -f1)"
+complete -c modprobe -n "not __fish_contains_opt -s r remove" --no-files -d Module -a "(find /lib/modules/(uname -r)/{kernel,misc} -type f 2>/dev/null | sed -e 's/\/.*\/\([^\/.]*\).*/\1/')"
complete -c modprobe -s v -l verbose --description "Print messages about what the program is doing"
complete -c modprobe -s C -l config --description "Configuration file" -r
complete -c modprobe -s c -l showconfig --description "Dump configuration file"