diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
commit | 206237c8ec4b7619d9e70a75004cd1ae1066b0a0 (patch) | |
tree | ff703cbc295605f90755edb68672ed2de11f4a81 /Functions/Zftp/zfopen | |
parent | 8ceb54fbc2f879e0e80f58c18761bd54db07e5f7 (diff) | |
download | zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.gz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.xz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.zip |
zsh-3.1.5-pws-16 zsh-3.1.5-pws-16-w6109 dot-zsh-199904280524
Diffstat (limited to 'Functions/Zftp/zfopen')
-rw-r--r-- | Functions/Zftp/zfopen | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Functions/Zftp/zfopen b/Functions/Zftp/zfopen new file mode 100644 index 000000000..fa9b4f81d --- /dev/null +++ b/Functions/Zftp/zfopen @@ -0,0 +1,42 @@ +# function zfopen { +# Use zftp params to set parameters for open, rather than sending +# them straight to open. That way they are stored for a future open +# command. +# +# With option -1 (just this 1ce), don't do that. + +emulate -L zsh + +local optlist opt once + +while [[ $1 = -* ]]; do + if [[ $1 = - || $1 = -- ]]; then + shift; + break; + fi + optlist=${1#-} + for (( i = 1; i <= $#optlist; i++)); do + opt=$optlist[$i] + case $optlist[$i] in + 1) once=1 + ;; + *) print option $opt not recognised >&2 + ;; + esac + done + shift +done + +# This is where we should try and do same name-lookupage in +# both .netrc and .ncftp/bookmarks . We could even try saving +# the info in their for new hosts, like ncftp does. + +if [[ $once = 1 ]]; then + zftp open $* +else + # set parameters, but only if there was at least a host + (( $# > 0 )) && zfparams $* + # now call with no parameters + zftp open +fi +# } |