diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-05-05 23:32:59 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-05-05 23:58:59 +0200 |
commit | db38e167634b6c2217eec3a5aafc37c46d9e5a8d (patch) | |
tree | daa342d423febbd3a5a7ef97053037677fab004a /Completion/Unix/Command/_screen | |
parent | 01eea47617a6e06debdb4330f92ae69f92089fd2 (diff) | |
parent | 3c3c8d3d13fd4cf6c03f81ca8dc18a1efd561728 (diff) | |
download | zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.tar.gz zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.zip |
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_screen')
-rw-r--r-- | Completion/Unix/Command/_screen | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/Completion/Unix/Command/_screen b/Completion/Unix/Command/_screen index 931946c78..510fd7195 100644 --- a/Completion/Unix/Command/_screen +++ b/Completion/Unix/Command/_screen @@ -1,20 +1,8 @@ #compdef screen -local curcontext="$curcontext" state line expl +local curcontext="$curcontext" state line expl ret=1 local scr_cmds sessions -function __screen_normal() { - if (( CURRENT == 1 )) && [[ $PREFIX == /dev/* ]]; then - _path_files -g '*(%)' - elif (( CURRENT == 2 )) && [[ ${words[1]} == /dev/* ]]; then - _message "baud rate" - elif (( CURRENT > 2 )) && [[ ${words[1]} == /dev/* ]]; then - _message "no more parameters" - else - _normal "$@" - fi -} - scr_cmds=( acladd aclchg acldel aclgrp aclumask activity addacl allpartial @@ -103,10 +91,21 @@ _arguments -C \ '-Dx: :->any-sessions' \ '-dx: :->any-sessions' \ '-X[execute command as a screen command in the specified session]:screencmd:(${scr_cmds[@]})' \ - '*::arguments: __screen_normal' + '*:: :->normal' && ret=0 if [[ -n $state ]]; then case $state in + normal) + if (( CURRENT == 1 )) && [[ $PREFIX == /dev/* ]]; then + _path_files -g '*(%)' + elif (( CURRENT == 2 )) && [[ ${words[1]} == /dev/* ]]; then + _message "baud rate" + elif (( CURRENT > 2 )) && [[ ${words[1]} == /dev/* ]]; then + _message "no more parameters" + else + _normal + fi + ;; attached-sessions) sessions=( ${${${(M)${(f)"$(_call_program screen-sessions $words[1] \ @@ -134,4 +133,6 @@ if [[ -n $state ]]; then _wanted screen-sessions expl "${state%-*} screen process" \ compadd ${sessions#*.} fi -fi +fi && ret=0 + +return ret |