diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-08-02 09:09:54 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-08-02 09:09:54 +0000 |
commit | eabfc368bd798b92f6b878430464b79de77c463f (patch) | |
tree | 49e88a79de4eac21f919688cc164c1aee7fd0368 /Completion/Base/_arguments | |
parent | aa13d7075fa6b6a53c2a8bf6935d82539bc17b6f (diff) | |
download | zsh-eabfc368bd798b92f6b878430464b79de77c463f.tar.gz zsh-eabfc368bd798b92f6b878430464b79de77c463f.tar.xz zsh-eabfc368bd798b92f6b878430464b79de77c463f.zip |
prefer user-defined specs over ones derived from --help output (12475)
Diffstat (limited to 'Completion/Base/_arguments')
-rw-r--r-- | Completion/Base/_arguments | 13 |
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 ... |