mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:05:39 +08: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
|
@ -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 New Issue
Block a user