diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2002-02-01 14:56:20 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2002-02-01 14:56:20 +0000 |
commit | 8a2469d72578f05aa2543d27f67d6c034a68aa8f (patch) | |
tree | 1347abc76283f16bd4fdfb03daf655912bf1222d | |
parent | 6ed6d4e2d6e91a1d5b16a5cf908aa749c680b2f0 (diff) | |
download | zsh-8a2469d72578f05aa2543d27f67d6c034a68aa8f.tar.gz zsh-8a2469d72578f05aa2543d27f67d6c034a68aa8f.tar.xz zsh-8a2469d72578f05aa2543d27f67d6c034a68aa8f.zip |
16449: new chkconfig completion for both the RedHat and IRIX commands
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/.distfiles | 1 | ||||
-rw-r--r-- | Completion/Unix/Command/_chkconfig | 33 |
3 files changed, 39 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index c5ea6996c..6ad3fa4a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,11 @@ * Matt Zimmerman: 16463: Completion/Debian/Command/_apt: completion for apt-cache showsrc. +2002-01-14 Oliver Kiddle <opk@zsh.org> + + * 16449: Completion/Unix/Command/_chkconfig: new completion for + both the IRIX and RedHat chkconfig commands + 2001-12-26 Clint Adams <clint@zsh.org> * 16375: Completion/Unix/Command/.distfiles, diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index ab568d28e..2763b7502 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -16,4 +16,5 @@ _dict _grep _lzop _prcs _tiff _elm _diff _gs _make _psutils _tin _apm _mail _loadkeys _modutils _ruby _samba _sysctl _links _user_admin _rsync _arping _spamassassin _mtools _fsh +_chkconfig ' diff --git a/Completion/Unix/Command/_chkconfig b/Completion/Unix/Command/_chkconfig new file mode 100644 index 000000000..92bc60c60 --- /dev/null +++ b/Completion/Unix/Command/_chkconfig @@ -0,0 +1,33 @@ +#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 |