about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-01 11:20:59 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-01 11:20:59 +0000
commit81fc1bf26c99ca62532051559ea3f68141abc026 (patch)
tree2d0d475306940060cb4c1cb23d7e79ce07b1c5b0
parentd109322359dc02e5008379da478628e2cace65e7 (diff)
downloadzsh-81fc1bf26c99ca62532051559ea3f68141abc026.tar.gz
zsh-81fc1bf26c99ca62532051559ea3f68141abc026.tar.xz
zsh-81fc1bf26c99ca62532051559ea3f68141abc026.zip
fix for automatically recognised options, don't expect an argument after each of them (12462)
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Base/_arguments6
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dc98dd66..531b64436 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-08-01  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 12462: Completion/Base/_arguments: fix for automatically
+ 	recognised options, don't expect an argument after each of them
+	
 	* 12453: Completion/Bsd/_bsd_pkg, Completion/Bsd/_kld,
  	Completion/Commands/_next_tags, Completion/User/_cvs,
  	Completion/User/_mailboxes, Completion/X/_xset,
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 6d09871df..2d55800a4 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -87,9 +87,11 @@ if (( long )); then
     done
 
     # Then we walk through the descriptions plus a few builtin ones.
+    # The last one matches all options; the `special' description and action
+    # makes those options be completed without an argument description.
 
     set -- "$@" '*=FILE*:file:_files' \
-           '*=(DIR|PATH)*:directory:_files -/' '*: :'
+           '*=(DIR|PATH)*:directory:_files -/' '*: :  '
 
     while (( $# )); do
 
@@ -147,7 +149,7 @@ if (( long )); then
 
       if (( $#tmp )); then
         tmp=("${(@)tmp//[^a-zA-Z0-9-]}")
-        if [[ -n "$descr" ]]; then
+        if [[ -n "$descr" && "$descr" != ': :  ' ]]; then
 	  cache=( "$cache[@]" "${(@)^tmp}${descr}" )
         else
 	  cache=( "$cache[@]" "$tmp[@]" )