summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-05-14 22:43:23 (GMT)
committerEvan Martin <martine@danga.com>2011-05-14 22:52:11 (GMT)
commit2ec1b4262151a70cb694395dd38d99a937ba13e3 (patch)
treed8fed68f7630f9f15894f198bfee7277cc4e45e2 /src
parent2f4244e82b00b4500ee5cff8e7a725811ec8c1fe (diff)
downloadNinja-2ec1b4262151a70cb694395dd38d99a937ba13e3.zip
Ninja-2ec1b4262151a70cb694395dd38d99a937ba13e3.tar.gz
Ninja-2ec1b4262151a70cb694395dd38d99a937ba13e3.tar.bz2
show started, not finished, edges in progress
In verbose mode (where we don't overprint) it's confusing to show [0/XX] for the first N commands we start. In smart terminal mode, I can't really tell the difference.
Diffstat (limited to 'src')
-rw-r--r--src/build.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/build.cc b/src/build.cc
index 5b2bddb..7a474a6 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -62,7 +62,7 @@ struct BuildStatus {
/// Time we last printed an update.
int64_t last_update_millis_;
- int finished_edges_, total_edges_;
+ int started_edges_, finished_edges_, total_edges_;
/// Map of running edge to time the edge started running.
typedef map<Edge*, int> RunningEdgeMap;
@@ -76,7 +76,7 @@ BuildStatus::BuildStatus(const BuildConfig& config)
: config_(config),
start_time_millis_(GetTimeMillis()),
last_update_millis_(start_time_millis_),
- finished_edges_(0), total_edges_(0) {
+ started_edges_(0), finished_edges_(0), total_edges_(0) {
#ifndef WIN32
const char* term = getenv("TERM");
smart_terminal_ = isatty(1) && term && string(term) != "dumb";
@@ -96,6 +96,7 @@ void BuildStatus::PlanHasTotalEdges(int total) {
void BuildStatus::BuildEdgeStarted(Edge* edge) {
int start_time = (int)(GetTimeMillis() - start_time_millis_);
running_edges_.insert(make_pair(edge, start_time));
+ ++started_edges_;
PrintStatus(edge);
}
@@ -157,7 +158,7 @@ void BuildStatus::PrintStatus(Edge* edge) {
if (smart_terminal_)
printf("\r"); // Print over previous line, if any.
- int progress_chars = printf("[%d/%d] ", finished_edges_, total_edges_);
+ int progress_chars = printf("[%d/%d] ", started_edges_, total_edges_);
#ifndef WIN32
if (smart_terminal_ && !force_full_command) {