summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-11-29 09:49:42 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-11-29 09:49:42 +0000
commitf518a387a8d7a1178b38943ffffe70b40dfc98ce (patch)
tree6b052fc58e0ad977cd513c8718ba53c653824472 /Completion/Unix/Command
parent5b887fa759f503ed854c44ecc759f1596ed8a104 (diff)
downloadzsh-f518a387a8d7a1178b38943ffffe70b40dfc98ce.tar.gz
zsh-f518a387a8d7a1178b38943ffffe70b40dfc98ce.tar.xz
zsh-f518a387a8d7a1178b38943ffffe70b40dfc98ce.zip
Kohsuke Kawaguchi: 24129: when completing ant targets,
skip those beginning - that cant be invoked from the command line
Diffstat (limited to 'Completion/Unix/Command')
-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