Skip to content

Commit

Permalink
fixed --progress switch
Browse files Browse the repository at this point in the history
  • Loading branch information
cruppstahl committed Jun 1, 2012
1 parent ca2816b commit 820615a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/controller.cpp
Expand Up @@ -2,10 +2,14 @@
#include "controller.hpp"
#include "thread.hpp"
#include <boost/thread/xtime.hpp>
#include <boost/progress.hpp>

void
Controller::run(std::vector<Thread *> &threads)
{
boost::progress_display *progress=0;
if (m_config->progress)
progress=new boost::progress_display(m_parser.get_max_lines());
m_lineno=1;

std::vector<Thread *>::iterator it;
Expand Down Expand Up @@ -40,11 +44,16 @@ Controller::run(std::vector<Thread *> &threads)
compare_records(threads);
}

m_lineno++;
++m_lineno;
if (progress)
++(*progress);
}

for (it=threads.begin(); it!=threads.end(); it++)
(*it)->wakeup();

if (progress)
delete progress;
}

void
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Expand Up @@ -451,6 +451,8 @@ main(int argc, char **argv)
delete threads[i];
threads.clear();

if (c.progress)
printf("\n");
if (ok)
printf("[OK] %s\n", c.filename);
else
Expand Down

0 comments on commit 820615a

Please sign in to comment.