summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-17 11:11:52 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-17 11:11:52 +0000
commit056cefac912a16640dcbb8f2c1dbd8f97ca3603f (patch)
treebd0bc66478b7f63cc071bb49b89e62c9c3c1d8bf /usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
parent1c03ee6c6dcfd52bc84bb4cc3a7b0ed1a9276ed2 (diff)
move the ntogo actual code in the progressmeter, so that -x shuts it off.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
index c20670e7b46..be7f8d7cc65 100644
--- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
+++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: ProgressMeter.pm,v 1.24 2009/12/14 09:35:56 espie Exp $
+# $OpenBSD: ProgressMeter.pm,v 1.25 2009/12/17 11:11:51 espie Exp $
#
# Copyright (c) 2004-2007 Marc Espie <espie@openbsd.org>
#
@@ -159,4 +159,15 @@ sub next
print "$header: ok$todo\n";
}
+sub ntogo
+{
+ my ($self, $todo) = @_;
+
+ if (defined $todo && $todo > 0) {
+ return " ($todo to go)";
+ } else {
+ return "";
+ }
+}
+
1;