fish-shell/share/completions/kldunload.fish
Mahmoud Al-Qudsi 121c70cf39 Add completions for FreeBSD's kldunload
Lists currently loaded kernel modules as valid completions, and obtains
a description via the newly minted `__fish_whatis` if available.
2018-06-27 14:14:40 -05:00

13 lines
332 B
Fish

function __fish_list_loaded_klds
set -l klds (kldstat | string match -r '\b\S+.ko$')
for kld in $klds
if set -l description (__fish_whatis (string replace '.ko' '' -- $kld) "kernel module")
printf '%s\t%s\n' $kld $description
else
printf '%s\n' $kld
end
end
end
complete -c kldunload -xa '(__fish_list_loaded_klds)'