diff --git a/CHANGELOG.md b/CHANGELOG.md index cc3d85787..ca637b2d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ This section is for changes merged to the `major` branch that are not also merge - `j` (autojump #4344) - `jhipster` (#4472) - `kldload` + - `kldunload` - `meson` - `ngrok` (#4642) - `optipng` diff --git a/share/completions/kldunload.fish b/share/completions/kldunload.fish new file mode 100644 index 000000000..d2db86e12 --- /dev/null +++ b/share/completions/kldunload.fish @@ -0,0 +1,12 @@ +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)'