From: Matthew Martin <phy1729@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [patch] _init_d add OpenBSD bits
Date: Thu, 21 Jan 2016 13:31:34 -0600 [thread overview]
Message-ID: <20160121193134.GA25505@CptOrmolo.darkstar> (raw)
In-Reply-To: <20160113005734.GA24858@tarsus.local2>
On Wed, Jan 13, 2016 at 12:57:34AM +0000, Daniel Shahaf wrote:
> Surely these should be single quotes around the last argument?
Updated diff after a few more comments from Daniel.
diff --git a/Completion/Unix/Command/_init_d b/Completion/Unix/Command/_init_d
index bbf62fc..2bb8d53 100644
--- a/Completion/Unix/Command/_init_d
+++ b/Completion/Unix/Command/_init_d
@@ -1,6 +1,7 @@
#compdef -p */(init|rc[0-9S]#).d/*
local cmds script
+local -a flags
_compskip=all
@@ -41,6 +42,23 @@ if [[ $OSTYPE = freebsd* ]]; then
return 0
}
+elif [[ $OSTYPE = openbsd* ]]; then
+ (( $+functions[_init_d_fullpath] )) ||
+ _init_d_fullpath() {
+ echo /etc/rc.d/$1
+ return 0
+ }
+
+ (( $+functions[_init_d_get_cmds] )) ||
+ _init_d_get_cmds() {
+ local -a cmds disabled
+
+ cmds=(start stop reload restart check)
+ disabled=(${${${(M)${(f)"$(< $script)"}:#rc_(${(~j:|:)cmds})=NO}#rc_}%=NO})
+ echo ${cmds:|disabled}
+ }
+
+ flags=('-d[print debug information]' '-f[forcibly start the daemon]')
else
(( $+functions[_init_d_fullpath] )) ||
_init_d_fullpath() {
@@ -90,4 +108,4 @@ cmds=( $(_init_d_get_cmds) ) || return
(( $#cmds )) || zstyle -a ":completion:${curcontext}:commands" commands cmds ||
cmds=(start stop)
-_sub_commands $cmds
+_arguments -s -A "-*" $flags ':init.d command:_sub_commands $cmds'
next prev parent reply other threads:[~2016-01-21 19:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-10 19:01 Matthew Martin
2016-01-13 0:57 ` Daniel Shahaf
2016-01-13 4:47 ` Matthew Martin
2016-01-21 19:31 ` Matthew Martin [this message]
2016-01-23 23:53 ` Daniel Shahaf
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=20160121193134.GA25505@CptOrmolo.darkstar \
--to=phy1729@gmail.com \
--cc=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/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).