summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2015-10-02 22:11:43 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2015-10-02 22:11:43 +0900
commite3bc9aa22843cb55912b909e00f54972eab5b2c5 (patch)
treef4a6417330d163d74c49c5eeb9df5217c072b14c /Completion/Unix/Command
parentfa72e547120581cdbff1b1695a47c2c19fed3487 (diff)
downloadzsh-e3bc9aa22843cb55912b909e00f54972eab5b2c5.tar.gz
zsh-e3bc9aa22843cb55912b909e00f54972eab5b2c5.tar.xz
zsh-e3bc9aa22843cb55912b909e00f54972eab5b2c5.zip
36732: _zsh now complets script args; also support -s, -b
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_zsh17
1 files changed, 16 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_zsh b/Completion/Unix/Command/_zsh
index 3b6d7ad4f..a5414670b 100644
--- a/Completion/Unix/Command/_zsh
+++ b/Completion/Unix/Command/_zsh
@@ -1,8 +1,23 @@
 #compdef zsh
 
+local curcontext=$curcontext state state_descr line expl
+typeset -A opt_args
+
 _arguments -S -s : \
   '*-o+[set named option]:option:_options' \
   '*+o+[unset named option]:option:_options' \
+  '(1 -s --shinstdin)'{-s,--shinstdin}'[read commands from standard input]' \
+  '(-)-b[end of option processing, like --]' \
   '(1 -)-c[run a command]:command:_cmdstring' \
   '(-)1:script file:_files' \
-  '*:command arguments' --
+  '*::script arguments:->args' -- && return 0
+
+case $state in
+  (args)
+    if [[ -n ${opt_args[(I)-c|-s|--shinstdin]} ]]; then
+      _files
+    else
+      _normal
+    fi
+    ;;
+esac