2019-12-17 09:31:43 -06:00
|
|
|
#include <chrono>
|
2019-12-16 11:03:31 -06:00
|
|
|
#include <indicators/progress_bar.hpp>
|
|
|
|
|
#include <thread>
|
|
|
|
|
|
|
|
|
|
int main() {
|
2020-02-03 21:12:33 +01:00
|
|
|
indicators::ProgressBar bar{
|
|
|
|
|
indicators::option::BarWidth{50},
|
|
|
|
|
indicators::option::Start{"["},
|
|
|
|
|
indicators::option::Fill{"="},
|
|
|
|
|
indicators::option::Lead{">"},
|
|
|
|
|
indicators::option::Remainder{" "},
|
|
|
|
|
indicators::option::End{" ]"},
|
|
|
|
|
indicators::option::PostfixText{"Getting started"},
|
|
|
|
|
indicators::option::ForegroundColor{indicators::Color::GREEN},
|
|
|
|
|
};
|
2019-12-17 09:31:43 -06:00
|
|
|
|
2019-12-16 11:03:31 -06:00
|
|
|
// Update bar state
|
|
|
|
|
while (true) {
|
|
|
|
|
bar.tick();
|
|
|
|
|
if (bar.is_completed())
|
|
|
|
|
break;
|
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|