summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2015-09-28 00:09:03 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2015-09-28 00:09:03 +0900
commit0cfa2dcfc424667f7fc29cf9a13c68883f3ffc28 (patch)
treecfe12c8eb77117510f07e7daaab4a38cc0c45766 /Completion/Unix
parent50721a1986a3637e923ccc4531135b8aa39c8e70 (diff)
downloadzsh-0cfa2dcfc424667f7fc29cf9a13c68883f3ffc28.tar.gz
zsh-0cfa2dcfc424667f7fc29cf9a13c68883f3ffc28.tar.xz
zsh-0cfa2dcfc424667f7fc29cf9a13c68883f3ffc28.zip
36631: separate _zsh from _sh
Do all the completion for zsh by _arguments
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_sh17
-rw-r--r--Completion/Unix/Command/_zsh8
2 files changed, 9 insertions, 16 deletions
diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh
index 1b5112212..2afb46621 100644
--- a/Completion/Unix/Command/_sh
+++ b/Completion/Unix/Command/_sh
@@ -1,13 +1,4 @@
-#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
+#compdef sh ksh bash csh tcsh rc
 
 if (( CURRENT == ${words[(i)-c]} + 1 )); then
   _cmdstring
@@ -21,9 +12,3 @@ else
   fi
   _default
 fi
-
-local ret=$?
-
-[[ $service == zsh ]] && _arguments -S -s -- && ret=0
-
-return ret
diff --git a/Completion/Unix/Command/_zsh b/Completion/Unix/Command/_zsh
new file mode 100644
index 000000000..3b6d7ad4f
--- /dev/null
+++ b/Completion/Unix/Command/_zsh
@@ -0,0 +1,8 @@
+#compdef zsh
+
+_arguments -S -s : \
+  '*-o+[set named option]:option:_options' \
+  '*+o+[unset named option]:option:_options' \
+  '(1 -)-c[run a command]:command:_cmdstring' \
+  '(-)1:script file:_files' \
+  '*:command arguments' --