Updated samples/demos to show usage of hide/show time elapsed/remaining

This commit is contained in:
Pranav Srinivas Kumar
2019-12-17 09:31:43 -06:00
parent 8198d8a802
commit 6224a46371
10 changed files with 72 additions and 43 deletions

View File

@@ -6,12 +6,14 @@ int main() {
std::cout << "\e[?25l";
indicators::ProgressSpinner spinner;
// Configure the spinner
spinner.set_postfix_text("Checking credentials");
spinner.set_foreground_color(indicators::Color::YELLOW);
spinner.set_spinner_states({"", "", "", "", "", "", "", ""});
spinner.hide_elapsed_time();
spinner.hide_remaining_time();
// Update spinner state
auto job = [&spinner]() {
while (true) {
@@ -32,7 +34,7 @@ int main() {
thread.join();
// Show cursor
std::cout << "\e[?25h";
std::cout << "\e[?25h";
return 0;
}