* PATCH: _chkconfig
@ 2002-01-14 13:08 Oliver Kiddle
0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2002-01-14 13:08 UTC (permalink / raw)
To: zsh-workers
New completion for both IRIX and RedHat chkconfig.
#compdef chkconfig
local curcontext="$curcontext" state line ret=1
case $OSTYPE in
linux*)
_arguments -C \
'(- 2)--list[list services]' \
'(-)--level[specify runlevels to apply to]:-:_values -s "" "run
levels" 1 2 3 4 5 6 7' \
'(- 2)--add[add new service]' \
'(- 2)--del[remove service from chkconfig management]' \
'1:service name:->services' \
'2:state:(on off reset)' && ret=0
if [[ -n "$state" ]]; then
_wanted services expl 'system service' \
compadd ${${${(f)"$($words[1] --list)"}%%[ :]*}##$'\t'*} &&
ret=0
fi
;;
irix*)
_arguments -C \
'(- 1)-s[print state of configuration flags]' \
'(1 -s)-f[set flag state]:configuration flag:->flag:state:(on off)'
\
'1:configuration flag:->flag' && ret=0
if [[ -n "$state" ]]; then
_wanted conf-flags expl 'configuration flag' \
compadd ${${${(f)"$($words[1])"}[4,-1]##$'\t'}%% *} && ret=0
fi
;;
esac
return ret
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-01-14 13:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-14 13:08 PATCH: _chkconfig Oliver Kiddle
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).