mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Fix and optimize kldload completions
I'm not sure what was wrong with the old syntax, but I needed to switch the outer quotes to ' and the inner quotes to " in order for the completions to work when they weren't explicitly sourced. Additionally, realized that the overload for __fish_complete_suffix can be used to get the filtered list of kernel modules from /boot/kernel in the initial run.
This commit is contained in:
parent
4d909b1c19
commit
fa00183e5f
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
)"
|
||||
)'
|
||||
|
|
Loading…
Reference in a new issue