Files
indicators/samples/progress_bar_countdown.cpp

32 lines
922 B
C++
Raw Normal View History

2020-05-24 23:03:39 -05:00
#include <chrono>
#include <indicators/progress_bar.hpp>
#include <thread>
using namespace indicators;
int main() {
ProgressBar bar{option::BarWidth{50},
option::ProgressType{ProgressType::decremental},
2020-05-24 23:07:02 -05:00
option::Start{"["},
2020-05-24 23:03:39 -05:00
option::Fill{""},
option::Lead{""},
option::Remainder{"-"},
option::End{"]"},
option::PostfixText{"Reverting System Restore"},
option::ForegroundColor{Color::yellow},
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}};
// Update bar state
while (true) {
bar.tick();
if (bar.is_completed())
break;
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
2020-05-24 23:07:02 -05:00
std::cout << termcolor::bold << termcolor::white << "Task Failed Successfully\n"
<< termcolor::reset;
2020-05-24 23:03:39 -05:00
return 0;
}