From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: completion for SysV initscripts
Date: Sun, 18 Mar 2001 09:15:23 -0500 [thread overview]
Message-ID: <20010318091523.A6942@dman.com> (raw)
This is perhaps a bit too Debian-centric, but should be okay
on any OS if the script uses a case statement.
Index: Completion/SysV/.distfiles
===================================================================
RCS file: .distfiles
diff -N .distfiles
--- /dev/null Mon Dec 11 17:26:27 2000
+++ .distfiles Sun Mar 18 06:08:22 2001
@@ -0,0 +1,4 @@
+DISTFILES_SRC='
+ .distfiles
+ _sysv_initscripts
+'
Index: Completion/SysV/_sysv_initscripts
===================================================================
RCS file: _sysv_initscripts
diff -N _sysv_initscripts
--- /dev/null Mon Dec 11 17:26:27 2000
+++ _sysv_initscripts Sun Mar 18 06:08:22 2001
@@ -0,0 +1,17 @@
+#compdef -p /etc/(init|rc[0-9S]).d/*
+
+local stdargs nonstdargs expl
+
+if [[ -f $words[1] ]]
+then
+nonstdargs=(${${(s: :)${${${${(M)${(f)"$(<$words[1])"}:#[ a-z-|]##\)*}%\)*}##\ #}:gs/|/ /}:s/ //}:#(start|stop|restart|force-reload|reload)})
+stdargs=(${(M)${(s: :)${${${${(M)${(f)"$(<$words[1])"}:#[ a-z-|]##\)*}%\)*}##\ #}:gs/|/ /}:s/ //}:#(start|stop|restart|force-reload|reload)})
+else
+nonstdargs=()
+stdargs=(start stop restart force-reload)
+fi
+
+_tags nonstdargs stdargs
+
+_wanted -V stdargs expl "standard arguments" compadd -a stdargs
+_wanted nonstdargs expl "non-standard arguments" compadd -a nonstdargs
next reply other threads:[~2001-03-18 14:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-18 14:15 Clint Adams [this message]
2001-03-18 17:57 ` Bart Schaefer
2001-03-18 19:49 ` Clint Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010318091523.A6942@dman.com \
--to=schizo@debian.org \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).