diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2010-04-20 08:59:32 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-04-20 08:59:32 +0000 |
commit | b230a690fa8a33551d229db083bca53a7075e1c8 (patch) | |
tree | 5a8f0a4e355067c972f2bcef824c35245fded547 /Completion/Unix/Type/_services | |
parent | df9cf1bf31ac810695505c517b9c9878cdfcc87c (diff) | |
download | zsh-b230a690fa8a33551d229db083bca53a7075e1c8.tar.gz zsh-b230a690fa8a33551d229db083bca53a7075e1c8.tar.xz zsh-b230a690fa8a33551d229db083bca53a7075e1c8.zip |
"Akinori MUSHA: 27892: update service & init completion for FreeBSD
Diffstat (limited to 'Completion/Unix/Type/_services')
-rw-r--r-- | Completion/Unix/Type/_services | 8 |
1 files changed, 7 insertions, 1 deletions
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:]]#}/%:*} ) |