From ed6298ad17c2c409b6a0f1dc9a4f4776c8f92fd4 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 10 Apr 2017 20:14:21 -0600 Subject: [PATCH] Fix portmaster completions when there are no matches Don't spew warnings when there are no matches. Also, use the string builtin instead of calling sed. Fixes #3949 --- share/completions/portmaster.fish | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/completions/portmaster.fish b/share/completions/portmaster.fish index 81cbacc91..f05c35755 100644 --- a/share/completions/portmaster.fish +++ b/share/completions/portmaster.fish @@ -48,8 +48,7 @@ complete -c portmaster -l version --description 'display the version number El E # Grab items from the ports directory, max depth 2 complete -c portmaster -f --description 'Ports Directory' -a " ( - ls -d /usr/ports/(commandline -ct)*/ \ - | sed -E -e 's#/usr/ports/##' -e 's#/+#/#' -e 's#([^/]+/[^/]+).*#\1#' + string match -r '(?<=/usr/ports/)[^/]*(?:/[^/]*)?' (__fish_complete_directories /usr/ports/(commandline -ct)) )" complete -c portmaster -f --description 'Installed Package' -a "(__fish_print_packages)"