From 3b0fb3cb7dca219f0e6280b77056d7d5261f7a01 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Thu, 21 Jul 2011 21:55:20 +0200 Subject: [PATCH] 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 --- etc/zsh/zshrc | 7 +++++++ usr_share_grml/zsh/completion/grml/_grmlinitd | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 usr_share_grml/zsh/completion/grml/_grmlinitd 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 -- 2.1.4