From 29056b09a0a72da922166a7d3fa1ce9b44808faa Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 22 Jul 2014 18:05:21 +0200 Subject: [PATCH] runit: import zsh completion for sv(8) from ignite --- srcpkgs/runit/files/_sv | 44 +++++++++++++++++++++++++++++++++++++++++ srcpkgs/runit/template | 4 +++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/runit/files/_sv diff --git a/srcpkgs/runit/files/_sv b/srcpkgs/runit/files/_sv new file mode 100644 index 00000000000..8a1de206367 --- /dev/null +++ b/srcpkgs/runit/files/_sv @@ -0,0 +1,44 @@ +#compdef sv + +# completion for runit sv(1) +# Christian Neukirchen +# runit 2.1.1, services in /var/service are completed by default + +local ret=1 services + +_arguments \ + '-v[verbose]' \ + '-w[wait]:seconds' \ + '1: :->cmds' \ + '*:: :->args' && ret=0 + +case $state in +cmds) + _values "sv command" \ + status \ + up \ + down \ + once \ + pause cont hup alarm interrupt quit 1 2 term kill \ + exit + # above allow one-character shortcuts, complete these + [[ $words[CURRENT] = [sudopchaiq12tke] ]] || + _values "sv command" \ + start \ + stop \ + restart \ + shutdown \ + force-stop \ + force-reload \ + force-restart \ + force-shutdown \ + check + ret=0;; +args) + services=( /var/service/*(-/N:t) ) + (( $#services )) && _values services $services && ret=0 + [[ $words[CURRENT] = */* ]] && _directories && ret=0 + ;; +esac + +return $ret diff --git a/srcpkgs/runit/template b/srcpkgs/runit/template index 3edbed2db5f..34ee5466f0e 100644 --- a/srcpkgs/runit/template +++ b/srcpkgs/runit/template @@ -1,7 +1,7 @@ # Template file for 'runit' pkgname=runit version=2.1.1 -revision=2 +revision=3 wrksrc="admin" short_desc="A UNIX init scheme with service supervision" maintainer="Juan RP " @@ -39,4 +39,6 @@ do_install() { vmkdir usr/share/doc/runit install -m0644 doc/*.html ${DESTDIR}/usr/share/doc/runit + + vinstall ${FILESDIR}/_sv 644 usr/share/zsh/site-functions }