From 61e68d70da5af5afe943f92cd94a8c96e78348d9 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 1 Aug 1999 14:48:28 +0000 Subject: zsh-3.1.6 --- Functions/Zftp/zfanon | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Functions/Zftp/zfanon') diff --git a/Functions/Zftp/zfanon b/Functions/Zftp/zfanon index d8a9d06a3..9624d48d9 100644 --- a/Functions/Zftp/zfanon +++ b/Functions/Zftp/zfanon @@ -2,7 +2,7 @@ emulate -L zsh -local opt optlist once +local opt optlist once dir while [[ $1 = -* ]]; do if [[ $1 = - || $1 = -- ]]; then @@ -61,10 +61,20 @@ if [[ -z $EMAIL_ADDR ]]; then print "Using $EMAIL_ADDR as anonymous FTP password." fi +if [[ $1 = */* ]]; then + 1=${1##ftp://} + dir=${1#*/} + 1=${1%%/*} +fi + if [[ $once = 1 ]]; then - zftp open $1 anonymous $EMAIL_ADDR + zftp open $1 anonymous $EMAIL_ADDR || return 1 else zftp params $1 anonymous $EMAIL_ADDR - zftp open + zftp open || return 1 +fi + +if [[ -n $dir ]]; then + zfcd $dir fi # } -- cgit 1.4.1