about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-01-30 03:38:29 +0000
committerClint Adams <clint@users.sourceforge.net>2002-01-30 03:38:29 +0000
commitc3e0113d1ce0895477d409a05ff19819ce5aa9bc (patch)
treec022aef965dd0c9960201d262042ea37f78db0cd
parenta2deb3854abfa4ef29fa35ab280399b10a17161a (diff)
downloadzsh-c3e0113d1ce0895477d409a05ff19819ce5aa9bc.tar.gz
zsh-c3e0113d1ce0895477d409a05ff19819ce5aa9bc.tar.xz
zsh-c3e0113d1ce0895477d409a05ff19819ce5aa9bc.zip
16514: initscript completion fixes
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/_init_d4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dbde8354..ebea335e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-01-29  Clint Adams  <clint@zsh.org>
+
+	* 16514: Completion/Unix/Command/_init_d: do not attempt
+	to read file if it doesn't exist, match pipe-separated lists
+	and characters following the parenthesis, and don't wantonly
+	remove hyphens from completions.
+
 2002-01-28  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 16507: Completion/Zsh/Type/_command_names: slight improvement
diff --git a/Completion/Unix/Command/_init_d b/Completion/Unix/Command/_init_d
index 280b0a9af..b8bd0c61f 100644
--- a/Completion/Unix/Command/_init_d
+++ b/Completion/Unix/Command/_init_d
@@ -9,8 +9,8 @@ local magic cmds what
 
 what='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)'
 
-read -u0k 2 magic < $words[1] && [[ $magic = '#!' ]] &&
-    cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $words[1])"}:#[[:blank:]]#(\'|)${~what}(|${~what})#(\'|)\)}}//[^a-z_]} )
+[[ -f $words[1] ]] && read -u0k 2 magic < $words[1] && [[ $magic = '#!' ]] &&
+    cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $words[1])"}:#[[:blank:]]#\'#${~what}(\|${~what})#\'#\)*}}//[^a-z_-]} )
 
 # This would be the pattern to use every line of the form <space>foo).
 # Some people say this might match too many lines...