about summary refs log tree commit diff
path: root/Completion/User/_rlogin
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-15 12:01:46 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-15 12:01:46 +0000
commit35b2633ad941966f5fca07b625a594a5b68c0fdb (patch)
treeb54740d014e594ba5d81931cdcdb3387bcf9dfca /Completion/User/_rlogin
parentbb98460a01ce1f6c1e71f7e401f782c81b71486b (diff)
downloadzsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.gz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.xz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.zip
manual/8639
Diffstat (limited to 'Completion/User/_rlogin')
-rw-r--r--Completion/User/_rlogin33
1 files changed, 13 insertions, 20 deletions
diff --git a/Completion/User/_rlogin b/Completion/User/_rlogin
index 898f10870..d732cf8a9 100644
--- a/Completion/User/_rlogin
+++ b/Completion/User/_rlogin
@@ -38,25 +38,21 @@ _rlogin () {
     return ret
     ;;
   rcp)
-    local state line ret=1
+    local curcontext="$curcontext" state line ret=1
     typeset -A opt_args
 
-    _arguments -s \
+    _arguments -C -s \
       '-p[preserve modification times]' \
       '-r[recursively copy directories]' \
       '*:files:->files' && ret=0
 
     if [[ -n "$state" ]]; then
       if compset -P '*:'; then
-        _tags "$context" files || return 1
-
 	_files && ret=0
       elif compset -P '*@'; then
-        _tags "$context" hosts || return 1
-
-	_rlogin_hosts -S: -q && ret=0
+        _tags hosts && _rlogin_hosts -S: -q && ret=0
       else
-        _alternative "$context" \
+        _alternative \
 	    'files:: _files' \
 	    'hosts:: _rlogin_all_hosts -qS:' \
 	    'users:: _rlogin_users -qS@' && ret=0
@@ -68,24 +64,21 @@ _rlogin () {
 }
 
 _rlogin_users () {
-  _tags any users && _combination accounts_users_hosts users "$@"
+  _tags users && _combination accounts_users_hosts users "$@"
 }
 
 _rlogin_hosts () {
-  _tags any hosts || return 1
-
-  if [[ "$IPREFIX" == *@ ]]; then
-    _combination accounts_users_hosts "users=${IPREFIX/@}" hosts "$@"
-  else
-    _combination accounts_users_hosts \
-      ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@"
-  fi
+  _tags hosts &&
+      if [[ "$IPREFIX" == *@ ]]; then
+        _combination accounts_users_hosts "users=${IPREFIX/@}" hosts "$@"
+      else
+        _combination accounts_users_hosts \
+            ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@"
+      fi
 }
 
 _rlogin_all_hosts () {
-  _tags any hosts || return 1
-
-  _combination accounts_users_hosts hosts "$@"
+  _tags hosts && _combination accounts_users_hosts hosts "$@"
 }
 
 _rlogin "$@"