1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 14:04:03 +01:00
zsh/Functions/Zftp/zfparams

28 lines
687 B
Plaintext
Raw Normal View History

1999-04-25 17:43:45 +02:00
# function zfparams {
emulate -L zsh
[[ $curcontext = :zf* ]] || local curcontext=:zfparams
1999-04-25 17:43:45 +02:00
if [[ $# -eq 1 && $1 = - ]]; then
# Delete existing parameter set.
local sess=$ZFTP_SESSION key
key=${zfconfig[fcache_$sess]}
[[ -n $key ]] && unset $key
for key in fcache lastloc lastdir curdir otherdir otherargs lastuser; do
unset "zfconfig[${key}_${sess}]"
done
elif (( $# > 0 )); then
# Set to prompt for any user or password if not given.
# Don't worry about accounts here.
1999-04-25 17:43:45 +02:00
(( $# < 2 )) && 2='?'
if (( $# < 3 )); then
if [[ $2 = '?'* ]]; then
3="?Password on ${1}: "
else
3="?Password for ${2##\\?} on ${1}: "
fi
fi
1999-04-25 17:43:45 +02:00
fi
zftp params $*
# }