about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2000-05-06 18:48:26 +0000
committerBart Schaefer <barts@users.sourceforge.net>2000-05-06 18:48:26 +0000
commitc15091b7d196c8fcc15bf8f13f8c7ccf62479b85 (patch)
treed6d2070110accd3434aab51133a7d3b7bcfcdfbc
parentbec1ee9e6ac04ccc34d0c83b3cf0dc1a88dafdc6 (diff)
downloadzsh-c15091b7d196c8fcc15bf8f13f8c7ccf62479b85.tar.gz
zsh-c15091b7d196c8fcc15bf8f13f8c7ccf62479b85.tar.xz
zsh-c15091b7d196c8fcc15bf8f13f8c7ccf62479b85.zip
11236: Handle tabs between options and their descriptions when parsing --help.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Base/_arguments8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ffeeeab3..3703df67e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
 	* 11224: Util/mkdisttree.sh: problem with pattern matching `.' in
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index cab1f778a..68f187af4 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -60,16 +60,16 @@ if (( long )); then
     # The parameter expansion trickery first gets the lines as separate
     # array elements. Then we select all lines whose first non-blank
     # 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 
     # the old array elements with newlines between them. Then we select
     # those elements that start with two hyphens, remove anything up to
-    # those hyphens and anything from the space or comma after the
-    # option up to the end. 
+    # those hyphens and anything from the space or tab after the
+    # option up to the end.
 
     lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call options ${~words[1]} --help 2>&1)//\[--/
 --}:#[ 	]#-*}//,/
-}}:#[ 	]#--*}#*--}%%[], ]*}:#}")
+}}:#[ 	]#--*}#*--}%%[]	 ]*}:#}")
     lopts=( "${(@)lopts:#--}" )
 
     # Now remove all ignored options ...