From: Frank Terbeck Date: Thu, 21 Jul 2011 19:55:20 +0000 (+0200) Subject: zshrc: Put _grmlinitd completion directly into zshrc. X-Git-Tag: v0.4.00~1 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=3b0fb3cb7dca219f0e6280b77056d7d5261f7a01 zshrc: Put _grmlinitd completion directly into zshrc. We provide the Start/Stop/... functions in our zshrc. But people don't necessarily install /usr/share/grml/zsh/completion/grml/_grmlinitd and therefore the completion is not available then. So lets make sure we provide the completion through the zshrc file itself. Reported-by: Othmar Gsenger --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 2410304..a20ad49 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2066,8 +2066,15 @@ if [[ -d /etc/init.d || -d /etc/service ]] ; then fi } + _grmlinitd() { + local -a scripts + scripts=( /etc/init.d/*(x:t) ) + _describe "service startup script" scripts + } + for i in Start Restart Stop Force-Reload Reload ; do eval "$i() { __start_stop $i \"\$1\" \"\$2\" ; }" + compdef _grmlinitd $i done fi diff --git a/usr_share_grml/zsh/completion/grml/_grmlinitd b/usr_share_grml/zsh/completion/grml/_grmlinitd deleted file mode 100644 index 177dfd5..0000000 --- a/usr_share_grml/zsh/completion/grml/_grmlinitd +++ /dev/null @@ -1,4 +0,0 @@ -#compdef Start Restart Stop Reload -local scripts -scripts=( ${$(print /etc/init.d/*(x)):t} ) -_describe "service startup script" scripts