about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-02 09:09:54 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-02 09:09:54 +0000
commiteabfc368bd798b92f6b878430464b79de77c463f (patch)
tree49e88a79de4eac21f919688cc164c1aee7fd0368
parentaa13d7075fa6b6a53c2a8bf6935d82539bc17b6f (diff)
downloadzsh-eabfc368bd798b92f6b878430464b79de77c463f.tar.gz
zsh-eabfc368bd798b92f6b878430464b79de77c463f.tar.xz
zsh-eabfc368bd798b92f6b878430464b79de77c463f.zip
prefer user-defined specs over ones derived from --help output (12475)
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Base/_arguments13
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f6530b8a..95ba5c2a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-02  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 12475: Completion/Base/_arguments: prefer user-defined specs
+ 	over ones derived from --help output
+	
 2000-08-01  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* Jan Fedak: 12463: Completion/User/_slrn: new completion function
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 2d55800a4..5a8da45ab 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -70,7 +70,18 @@ if (( long )); then
     lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call options ${~words[1]} --help 2>&1)//\[--/
 --}:#[ 	]#-*}//,/
 }}:#[ 	]#--*}#*--}%%[]	 ]*}:#}")
-    lopts=( "${(@)lopts:#--}" )
+
+    # Remove options also described by user-defined specs.
+
+    tmp=()
+    for opt in "${(@)lopts:#--}"; do
+
+      # Using (( ... )) gives a parse error.
+
+      let "$tmpargv[(I)(|\([^\)]#\))${opt}(|[-+=])(|\[*\])(|:*)]" ||
+          tmp=( "$tmp[@]" "$opt" )
+    done
+    lopts=( "$tmp[@]" )
 
     # Now remove all ignored options ...