From: Edgar Merino <donvodka@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Completion function patches
Date: Sun, 04 Oct 2009 08:04:14 -0500 [thread overview]
Message-ID: <4AC89D4E.6050608@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 497 bytes --]
Hello, I recently had to work with two utility functions for the
completion system: _services and _init_d. I'm running archlinux and here
services are under the /etc/rc.d directory, instead of the default
directory that appears in those 2 scripts (/etc/init.d). Attached I
provide you with pataches for both scripts, so that they work fine when
running a system with an init framework similar to mine. Please let me
know if I should do something else to contribute this code.
Edgar Merino
[-- Attachment #2: _init_d.patch --]
[-- Type: text/plain, Size: 472 bytes --]
--- _init_d 2009-10-04 07:54:44.000000000 -0500
+++ _init_d.new 2009-10-04 07:38:15.000000000 -0500
@@ -7,7 +7,7 @@
# This should probably be system specific...
script=$words[1]
-[[ $script = */* ]] || script=/etc/init.d/$script
+[[ $script = */* ]] || script=`[ -d /etc/init.d ] && echo /etc/init.d || echo /etc/rc.d`/$script
# If the file starts with `#!' we hope that this is a shell script
# and get lines looking like <space>foo|bar) with the words in $what.
[-- Attachment #3: _services.patch --]
[-- Type: text/plain, Size: 491 bytes --]
--- _services 2009-10-04 08:00:36.000000000 -0500
+++ _services.new 2009-10-04 07:38:25.000000000 -0500
@@ -12,7 +12,8 @@
'init:init service:compadd -a inits' \
'xinetd:xinetd service:compadd -a xinetds' && ret=0
else
- _wanted services expl service compadd "$@" - /etc/init.d/*(-*:t) && ret=0
+ services_directory=`[ -d /etc/init.d ] && echo /etc/init.d || echo /etc/rc.d`;
+ _wanted services expl service compadd "$@" - $services_directory/*(-*:t) && ret=0
fi
return ret
next reply other threads:[~2009-10-04 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-04 13:04 Edgar Merino [this message]
2009-10-04 18:13 ` Peter Stephenson
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=4AC89D4E.6050608@gmail.com \
--to=donvodka@gmail.com \
--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).