about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-12-01 02:35:16 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-12-01 02:35:16 +0000
commitb7589d91dad172a1544a5f2803d76bed0199752f (patch)
tree703db2ff84969eb3cf205896a4fb9b240bf1e4c2
parent1656f4ee2288e755c045c4d8b3e189900212f4e5 (diff)
downloadzsh-b7589d91dad172a1544a5f2803d76bed0199752f.tar.gz
zsh-b7589d91dad172a1544a5f2803d76bed0199752f.tar.xz
zsh-b7589d91dad172a1544a5f2803d76bed0199752f.zip
Merge of 24129 from Kohsuke Kawaguchi: skip targets that can't be invoked
from the command line.
-rw-r--r--Completion/Unix/Command/_ant4
1 files changed, 3 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
index 7e7d14c2a..90f2f5699 100644
--- a/Completion/Unix/Command/_ant
+++ b/Completion/Unix/Command/_ant
@@ -8,7 +8,9 @@ local buildfile classpath cp userjars importedfiles target='*:target:->target' t
 
 find_targets() {
     importedfiles=( $(sed -n "s/ *<import[^>]* file=[\"']\([^\"']*\)[\"'].*/\1/p" < $1) )
-    sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" $1
+    # Tweaked to omit targets beginning with "-" that can't
+    # be invoked from the command line; see zsh-workers/24129.
+    sed -n "s/ *<target[^>]*  name=[\"']\([^-][^\"']*\)[\"'].*/\1/p" $1
     if (( $#importedfiles )) ; then
 	( cd $1:h
     	for file in $importedfiles ; do