zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: completion for rlogin and friends
@ 1999-09-09 11:09 Sven Wischnowsky
  1999-09-09 12:30 ` Adam Spiers
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 1999-09-09 11:09 UTC (permalink / raw)
  To: zsh-workers


Well, just improving `_rlogin' a bit.

Bye
 Sven

diff -u -r oldcompletion/User/_rlogin Completion/User/_rlogin
--- oldcompletion/User/_rlogin	Thu Sep  9 11:22:40 1999
+++ Completion/User/_rlogin	Thu Sep  9 13:03:11 1999
@@ -1,19 +1,51 @@
-#compdef rlogin rsh
+#compdef rlogin rsh remsh rcp
 
-local expl
+case "$words[1]" in
+rlogin)
+  _arguments -s \
+    '-8[allow 8-Bit data]' \
+    '-e-[specify escape character]:escape character:' \
+    '-l[specify login user name]:login as:_users' \
+    ':remote host name:_hosts'
+  ;;
+rsh|remsh)
+  local state line ret=1
+  typeset -A options
 
-_description expl user
+  _arguments -s \
+    '-n[ignore stdin]' \
+    '-l[specify login user name]:login as:_users' \
+    ':remote host name:_hosts' \
+    ':command: _command_names -e' \
+    '*::command:->command' && ret=0
 
-if [[ CURRENT -eq 2 ]];
-  if compset -P 1 '*@'; then
-   _hosts
-  else
-    local nm=${compstate[nmatches]}
-    _hosts
-    [[ nm -eq compstate[nmatches] ]] && compgen "$expl[@]" -S @ -u
+  if [[ -n "$state" ]]; then
+    shift 1 words
+    (( CURRENT-- ))
+    _normal && ret=0
   fi
-elif [[ CURRENT -eq 3 ]]; then
-  compadd - -l
-else
-  _users -S @
-fi
+  return ret
+  ;;
+rcp)
+  local state line ret=1
+  typeset -A options
+
+  _arguments -s \
+    '-p[preserve modification times]' \
+    '-r[recursively copy directories]' \
+    '*:files:->files' && ret=0
+
+  if [[ -n "$state" ]]; then
+    if compset -P '*:'; then
+      _files && ret=0
+    elif compset -P '*@'; then
+      _hosts -S: && ret=0
+    else
+      _files && ret=0
+      _hosts -S: && ret=0
+      _users -S@ && ret=0
+    fi
+  fi
+  return ret
+  ;;    
+esac

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: completion for rlogin and friends
  1999-09-09 11:09 PATCH: completion for rlogin and friends Sven Wischnowsky
@ 1999-09-09 12:30 ` Adam Spiers
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Spiers @ 1999-09-09 12:30 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote:
> 
> Well, just improving `_rlogin' a bit.
> 
> diff -u -r oldcompletion/User/_rlogin Completion/User/_rlogin
> --- oldcompletion/User/_rlogin	Thu Sep  9 11:22:40 1999
> +++ Completion/User/_rlogin	Thu Sep  9 13:03:11 1999
> @@ -1,19 +1,51 @@
> -#compdef rlogin rsh
> +#compdef rlogin rsh remsh rcp

Shouldn't scp be in that too?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: completion for rlogin and friends
@ 1999-09-09 13:01 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-09-09 13:01 UTC (permalink / raw)
  To: zsh-workers


Adam Spiers wrote:

> > -#compdef rlogin rsh
> > +#compdef rlogin rsh remsh rcp
> 
> Shouldn't scp be in that too?

It's in `_ssh'.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-09-09 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-09 11:09 PATCH: completion for rlogin and friends Sven Wischnowsky
1999-09-09 12:30 ` Adam Spiers
1999-09-09 13:01 Sven Wischnowsky

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).