From 5061f1666b3ee775b258dce42331f9bc8a9ff11d Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Mon, 18 Jun 2018 21:01:05 -0500 Subject: [PATCH] Add completions for FreeBSD's kldload --- CHANGELOG.md | 1 + share/completions/kldload.fish | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 share/completions/kldload.fish diff --git a/CHANGELOG.md b/CHANGELOG.md index 781664992..86933dae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ This section is for changes merged to the `major` branch that are not also merge - `configure` (autoconf only) - `j` (autojump #4344) - `jhipster` (#4472) + - `kldload` - `meson` - `ngrok` (#4642) - `optipng` diff --git a/share/completions/kldload.fish b/share/completions/kldload.fish new file mode 100644 index 000000000..f55c9e211 --- /dev/null +++ b/share/completions/kldload.fish @@ -0,0 +1,9 @@ +# Completions for the FreeBSD `kldload` kernel module load utility + +# 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; + or __fish_complete_suffix .ko +)"