summaryrefslogtreecommitdiff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/_arguments13
1 files changed, 12 insertions, 1 deletions
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 ...