mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 10:21:46 +02:00
prefer user-defined specs over ones derived from --help output (12475)
This commit is contained in:
parent
aa13d7075f
commit
eabfc368bd
2 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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 ...
|
||||
|
||||
|
|
Loading…
Reference in a new issue