From e6f4c9e162dc8068f598711506b11498452cd032 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sun, 24 Jul 2022 09:51:15 +0200 Subject: [PATCH] completions/service: Fix output on OpenRC systems This used `type -f`, which prints, and only silenced stderr. Detected by running the check-completions test on Alpine. It appears nobody does that. --- share/completions/service.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/service.fish b/share/completions/service.fish index b043388f1..e668f66c9 100644 --- a/share/completions/service.fish +++ b/share/completions/service.fish @@ -4,7 +4,7 @@ complete -c service -n "__fish_is_nth_token 1" -xa "(__fish_print_service_names) # as found in __fish_print_service_names.fish if test -d /run/systemd/system # Systemd systems complete -c service -n 'not __fish_is_nth_token 1' -xa "start stop restart status enable disable" -else if type -f rc-service 2>/dev/null # OpenRC (Gentoo) +else if command -sq rc-service # OpenRC (Gentoo) complete -c service -n 'not __fish_is_nth_token 1' -xa "start stop restart" else if test -d /etc/init.d # SysV on Debian and other linuxen complete -c service -n 'not __fish_is_nth_token 1' -xa "start stop --full-restart"