Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Ignore informational messages in 'service' command completion script



Hi,

In Fedora 16, 'service' command completion showed information printed by 'chkconfig --list' to stderr.


diff --git a/Completion/Unix/Type/_services b/Completion/Unix/Type/_services
index 4960547..3dd1e12 100644
--- a/Completion/Unix/Type/_services
+++ b/Completion/Unix/Type/_services
@@ -10,7 +10,7 @@ if [[ $OSTYPE = freebsd* ]]; then
     _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)"} )
+  alls=( ${(f)"$(LANGUAGE=C LANG=C LC_ALL=C chkconfig --list 2> /dev/null)"} )
   inits=( ${${${alls[1,(r)xinetd based*]}[1,-2]}/%[[:space:]]*/} )
   xinetds=( ${${${${alls[(r)xinetd based*,-1]}[2,-1]}/#[[:space:]]#}/%:*} )



Messages sorted by: Reverse Date, Date, Thread, Author