X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_cli.cc;h=9388112f6e613861a621ab20d86a222982389109;hb=dcdc54106d788eb11bc15b719528455ffc65b0e5;hp=f049c0c919cc6fc12a6b87150ba6b0a0b85a8976;hpb=985e727e001e1a92ae035364a9cbf1ff99522ff1;p=dcpomatic.git diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index f049c0c91..9388112f6 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -350,64 +350,7 @@ main (int argc, char* argv[]) } film->make_dcp (); - - bool should_stop = false; - bool first = true; - bool error = false; - while (!should_stop) { - - dcpomatic_sleep (5); - - list > jobs = JobManager::instance()->get (); - - if (!first && progress) { - for (size_t i = 0; i < jobs.size(); ++i) { - cout << "\033[1A\033[2K"; - } - cout.flush (); - } - - first = false; - - int unfinished = 0; - int finished_in_error = 0; - - BOOST_FOREACH (shared_ptr i, jobs) { - if (progress) { - cout << i->name(); - if (!i->sub_name().empty()) { - cout << "; " << i->sub_name(); - } - cout << ": "; - - if (i->progress ()) { - cout << i->status() << " \n"; - } else { - cout << ": Running \n"; - } - } - - if (!i->finished ()) { - ++unfinished; - } - - if (i->finished_in_error ()) { - ++finished_in_error; - error = true; - } - - if (!progress && i->finished_in_error ()) { - /* We won't see this error if we haven't been showing progress, - so show it now. - */ - cout << i->status() << "\n"; - } - } - - if (unfinished == 0 || finished_in_error != 0) { - should_stop = true; - } - } + bool const error = show_jobs_on_console (progress); if (keep_going) { while (true) {