zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _rlogin splits up into three functions (still one file)
Date: Tue, 19 Sep 2000 05:10:37 +0000	[thread overview]
Message-ID: <1000919051038.ZM30425@candle.brasslantern.com> (raw)

For consideration (i.e., not yet committed).  This makes it a little easier
to write a wrapper, e.g. Jay's Kerberized version could become

	#compdef krlogin krsh krcp
	compdef ${words[1]:t:s/k/_/} ${words[1]:t}
	_rlogin "$@"

Though of course that needs to become documented before he can rely on it.

Index: Completion/User/_rlogin
===================================================================
@@ -1,15 +1,18 @@
 #compdef rlogin rsh remsh rcp
 
+[[ $_comps[rsh] == _rlogin ]] && compdef _rsh rsh
+[[ $_comps[remsh] == _rlogin ]] && compdef _rsh remsh
+[[ $_comps[rcp] == _rlogin ]] && compdef _rcp rcp
+
 _rlogin () {
-  case "${words[1]:t}" in
-  rlogin)
     _arguments -s \
       '-8[allow 8-Bit data]' \
       '-e-[specify escape character]:escape character:' \
       '-l[specify login user name]:login as:_rlogin_users' \
       ':remote host name:_rlogin_hosts'
-    ;;
-  rsh|remsh)
+}
+
+_rsh() {
     local context state line ret=1
     typeset -A opt_args
 
@@ -26,8 +29,9 @@
       _normal && ret=0
     fi
     return ret
-    ;;
-  rcp)
+}
+
+_rcp () {
     local curcontext="$curcontext" state line ret=1 expl
     typeset -A opt_args
 
@@ -49,8 +53,6 @@
       fi
     fi
     return ret
-    ;;    
-  esac
 }
 
 _rlogin_users () {
@@ -71,4 +73,4 @@
   _tags hosts && _combination -s '[:@]' my-accounts users-hosts hosts "$@"
 }
 
-_rlogin "$@"
+$_comps[${words[1]:t}] "$@"

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


             reply	other threads:[~2000-09-19  5:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-19  5:10 Bart Schaefer [this message]
2000-10-04  9:54 Sven Wischnowsky
2000-10-04 16:03 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1000919051038.ZM30425@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).