zshrc: Put _grmlinitd completion directly into zshrc.
authorFrank Terbeck <ft@grml.org>
Thu, 21 Jul 2011 19:55:20 +0000 (21:55 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 21 Jul 2011 21:41:58 +0000 (23:41 +0200)
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 <otti@anytun.org>
etc/zsh/zshrc
usr_share_grml/zsh/completion/grml/_grmlinitd [deleted file]

index 2410304..a20ad49 100644 (file)
@@ -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 (file)
index 177dfd5..0000000
+++ /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