about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-08-28 20:35:53 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-08-28 20:35:53 +0000
commite8f8c3abee5763d58cfcb8eb89e50ec40dbcfde2 (patch)
treeb2c278c0fab03ba3cd969ef200d806dacd32b3ad
parentb3336b791893f0c6a85c0aa9cec744af6a2c8d40 (diff)
downloadzsh-e8f8c3abee5763d58cfcb8eb89e50ec40dbcfde2.tar.gz
zsh-e8f8c3abee5763d58cfcb8eb89e50ec40dbcfde2.tar.xz
zsh-e8f8c3abee5763d58cfcb8eb89e50ec40dbcfde2.zip
handle zsh options in _sh
-rw-r--r--ChangeLog2
-rw-r--r--Completion/Unix/Command/_sh9
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a9b68a97..95b1d59da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2001-08-28  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
 
+	* 15722: Completion/Unix/Command/_sh: handle zsh options.
+
 	* 15720: Functions/Misc/zmv: use ${(e)...} as suggested by
 	Bart; fix problem with option arguments with special characters;
 	more consistency with shifting arguments; fix verbose mode
diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh
index 22379856e..559c6ad1b 100644
--- a/Completion/Unix/Command/_sh
+++ b/Completion/Unix/Command/_sh
@@ -1,5 +1,14 @@
 #compdef sh ksh bash zsh csh tcsh rc
 
+if [[ $service == zsh ]]; then
+  # try a bit harder
+  if [[ ${words[CURRENT-1]} == -o ]]; then
+    _options
+    # no other possibilities
+    return
+  fi
+fi
+
 if (( CURRENT == ${words[(i)-c]} + 1 )); then
   compset -q
   _normal