about summary refs log tree commit diff
path: root/Functions/Zftp/zftp_progress
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-15 21:33:36 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-15 21:33:36 +0000
commitce9d10e465acd5a5641778154d176fd737d47eed (patch)
tree4a82590f469b3eae8ffb3ab1d027406d6bad3f9e /Functions/Zftp/zftp_progress
parent03e230cc54103d18e9c8a18208c7d27805400a71 (diff)
downloadzsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar.gz
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar.xz
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.zip
zsh-workers/9067
Diffstat (limited to 'Functions/Zftp/zftp_progress')
-rw-r--r--Functions/Zftp/zftp_progress15
1 files changed, 8 insertions, 7 deletions
diff --git a/Functions/Zftp/zftp_progress b/Functions/Zftp/zftp_progress
index b4b639fce..79a20c37e 100644
--- a/Functions/Zftp/zftp_progress
+++ b/Functions/Zftp/zftp_progress
@@ -1,7 +1,7 @@
 # function zftp_progress {
 # Basic progress metre, showing the percent of the file transferred.
 # You want growing bars?  You gottem.
-# zfconfig keys:
+# styles used (context :zftp:zfparent_function:):
 #   progress
 #       empty or `none'                  no progress meter
 #       `bar'                            use a growing bar of inverse video
@@ -11,16 +11,17 @@
 #   update
 #       Minimum time in seconds between updates of the progress display.
 
-# Don't show progress unless stderr is a terminal
-[[ ! -t 2 || ${zfconfig[progress]} = (|none) ]] && return 0
+local style update=1
 
-# Tunable parameters.
-# How many seconds to wait before printing an updated progress report.
-integer update=${zfconfig[update]:-1}
 # What style: either bar for growing bars, or anything else for simple
 # percentage.  For bar we need to have the terminal width in COLUMNS,
 # which is often set automatically, but you never know.
-local style=${zfconfig[progress]}
+zstyle -s ":zftp$curcontext" progress style
+# How many seconds to wait before printing an updated progress report.
+zstyle -s ":zftp$curcontext" update update
+
+# Don't show progress unless stderr is a terminal
+[[ ! -t 2 || $style = (|none) ]] && return 0
 
 if [[ -n $ZFTP_TRANSFER ]]; then
   # avoid a `parameter unset' message