Diff
Not logged in

Differences From:

File tools/lib/log.tcl part of check-in [86a7f249c1] - Started to restructure the namespace hierarchy, beginning at the bottom, with the log module. by aku on 2007-09-09 00:58:18. [view]

To:

File tools/lib/log.tcl part of check-in [ebb94f75cb] - Semantics of the progress display extended to allow an empty maximum to signal use of an infinite (open-ended) display. by aku on 2007-09-17 01:41:58. [view]

@@ -13,8 +13,10 @@
 # Feedback generation.
 #
 #	vc::tools::log::write    verbosity system text  - Write message to the log.
 #	vc::tools::log::progress verbosity system n max - Drive a progress display.
+#
+#       Note: max empty => infinite progress display, otherwise a finite display.
 
 # Administrative operations.
 #
 #	vc::tools::log::verbosity level  - Set the verbosity level of the application.
@@ -123,9 +125,13 @@
 # Progress handler. Uses \r to return to the beginning of the current
 # line without advancing.
 
 proc ::vc::tools::log::OUT/progress {system n max} {
-    puts -nonewline "$system [format %[string length $max]s $n]/$max\r"
+    if {$max eq {}} {
+	puts -nonewline "$system $n\r"
+    } else {
+	puts -nonewline "$system [format %[string length $max]s $n]/$max\r"
+    }
     flush stdout
     return
 }