mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-26 05:51:08 +02:00
11236: Handle tabs between options and their descriptions when parsing --help.
This commit is contained in:
parent
bec1ee9e6a
commit
c15091b7d1
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2000-05-06 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 11236: Completion/Base/_arguments: Handle tabs between options
|
||||||
|
and their descriptions when parsing --help output.
|
||||||
|
|
||||||
2000-05-06 Tanaka Akira <akr@zsh.org>
|
2000-05-06 Tanaka Akira <akr@zsh.org>
|
||||||
|
|
||||||
* 11224: Util/mkdisttree.sh: problem with pattern matching `.' in
|
* 11224: Util/mkdisttree.sh: problem with pattern matching `.' in
|
||||||
|
|
|
@ -60,16 +60,16 @@ if (( long )); then
|
||||||
# The parameter expansion trickery first gets the lines as separate
|
# The parameter expansion trickery first gets the lines as separate
|
||||||
# array elements. Then we select all lines whose first non-blank
|
# array elements. Then we select all lines whose first non-blank
|
||||||
# character is a hyphen. Since some commands document more than one
|
# character is a hyphen. Since some commands document more than one
|
||||||
# option per line, separated by commas, we convert commas int
|
# option per line, separated by commas, we convert commas into
|
||||||
# newlines and then split the result again at newlines after joining
|
# newlines and then split the result again at newlines after joining
|
||||||
# the old array elements with newlines between them. Then we select
|
# the old array elements with newlines between them. Then we select
|
||||||
# those elements that start with two hyphens, remove anything up to
|
# those elements that start with two hyphens, remove anything up to
|
||||||
# those hyphens and anything from the space or comma after the
|
# those hyphens and anything from the space or tab after the
|
||||||
# option up to the end.
|
# option up to the end.
|
||||||
|
|
||||||
lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call options ${~words[1]} --help 2>&1)//\[--/
|
lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call options ${~words[1]} --help 2>&1)//\[--/
|
||||||
--}:#[ ]#-*}//,/
|
--}:#[ ]#-*}//,/
|
||||||
}}:#[ ]#--*}#*--}%%[], ]*}:#}")
|
}}:#[ ]#--*}#*--}%%[] ]*}:#}")
|
||||||
lopts=( "${(@)lopts:#--}" )
|
lopts=( "${(@)lopts:#--}" )
|
||||||
|
|
||||||
# Now remove all ignored options ...
|
# Now remove all ignored options ...
|
||||||
|
|
Loading…
Reference in a new issue