diff --git a/share/completions/kldload.fish b/share/completions/kldload.fish index f55c9e211..4e430911a 100644 --- a/share/completions/kldload.fish +++ b/share/completions/kldload.fish @@ -2,8 +2,8 @@ # Only attempt to match a local file if there isn't a match in /boot/kernel, # as odds are that is the desired source. -complete -c kldload -xa "( - set results (find /boot/kernel -depth 1 -iname (commandline -ct)'*.ko' | sed 's@.*/@@g;s/\.ko//'); - set -q results[1]; and printf '%s\n' $results; +complete -c kldload -xa '( + set results (__fish_complete_suffix /boot/kernel/(commandline -ct) ".ko" | sed "s@.*/@@g;s/\.ko//"); + set -q results[1]; and printf "%s\n" $results; or __fish_complete_suffix .ko -)" +)'