From b230a690fa8a33551d229db083bca53a7075e1c8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 20 Apr 2010 08:59:32 +0000 Subject: "Akinori MUSHA: 27892: update service & init completion for FreeBSD --- Completion/Unix/Type/_services | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Type') diff --git a/Completion/Unix/Type/_services b/Completion/Unix/Type/_services index 40136e3c1..496054795 100644 --- a/Completion/Unix/Type/_services +++ b/Completion/Unix/Type/_services @@ -3,7 +3,13 @@ local -a inits xinetds alls local expl ret=1 -if chkconfig --list > /dev/null 2>&1; then +if [[ $OSTYPE = freebsd* ]]; then + if [[ -x /usr/sbin/service ]]; then + alls=( $(service -l) ) && ret=0 + + _wanted services expl service compadd "$@" - $alls[@] && ret=0 + fi +elif chkconfig --list > /dev/null 2>&1; then alls=( ${(f)"$(LANGUAGE=C LANG=C LC_ALL=C chkconfig --list)"} ) inits=( ${${${alls[1,(r)xinetd based*]}[1,-2]}/%[[:space:]]*/} ) xinetds=( ${${${${alls[(r)xinetd based*,-1]}[2,-1]}/#[[:space:]]#}/%:*} ) -- cgit 1.4.1