summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-02-12 23:27:32 +0000
committerCarl Hetherington <cth@carlh.net>2013-02-12 23:27:32 +0000
commitba079aaab20805d743c49f7a43bf6ce0170db231 (patch)
tree1458ac70b4c0ecbc89bfbbb8f95c009ac020a7f4 /src/lib
parent7430890e041396866f1fe76befbd331ae048cc84 (diff)
Never say 100% when not finished (part of #44).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/job.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 2ddcf5335..dd034bf0c 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -267,11 +267,17 @@ Job::status () const
int const t = elapsed_time ();
int const r = remaining_time ();
+ int pc = rint (p * 100);
+ if (pc == 100) {
+ /* 100% makes it sound like we've finished when we haven't */
+ pc = 99;
+ }
+
stringstream s;
if (!finished () && p >= 0 && t > 10 && r > 0) {
- s << rint (p * 100) << "%; " << seconds_to_approximate_hms (r) << " remaining";
+ s << pc << "%; " << seconds_to_approximate_hms (r) << " remaining";
} else if (!finished () && (t <= 10 || r == 0)) {
- s << rint (p * 100) << "%";
+ s << pc << "%";
} else if (finished_ok ()) {
s << "OK (ran for " << seconds_to_hms (_ran_for) << ")";
} else if (finished_in_error ()) {