mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
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.
This commit is contained in:
parent
948b9d2ab8
commit
121c70cf39
2 changed files with 13 additions and 0 deletions
|
@ -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`
|
||||
|
|
12
share/completions/kldunload.fish
Normal file
12
share/completions/kldunload.fish
Normal file
|
@ -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)'
|
Loading…
Reference in a new issue