mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-14 03:08:52 +08:00
Updated enums to lowercase per the core guidelines. Bumped to wip v1.7
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.8)
|
||||||
project(indicators VERSION 1.6.0 LANGUAGES CXX DESCRIPTION "Activity Indicators for Modern C++")
|
project(indicators VERSION 1.7.0 LANGUAGES CXX DESCRIPTION "Activity Indicators for Modern C++")
|
||||||
option(INDICATORS_BUILD_TESTS OFF)
|
option(INDICATORS_BUILD_TESTS OFF)
|
||||||
option(SAMPLES "Build Samples" OFF)
|
option(SAMPLES "Build Samples" OFF)
|
||||||
option(DEMO "Build Demo" OFF)
|
option(DEMO "Build Demo" OFF)
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -12,7 +12,7 @@
|
|||||||
<a href="https://github.com/p-ranav/indicators/blob/master/LICENSE">
|
<a href="https://github.com/p-ranav/indicators/blob/master/LICENSE">
|
||||||
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="license"/>
|
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="license"/>
|
||||||
</a>
|
</a>
|
||||||
<img src="https://img.shields.io/badge/version-1.6-blue.svg?cacheSeconds=2592000" alt="version"/>
|
<img src="https://img.shields.io/badge/version-1.7-blue.svg?cacheSeconds=2592000" alt="version"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -71,7 +71,7 @@ int main() {
|
|||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{"]"},
|
option::End{"]"},
|
||||||
option::PostfixText{"Extracting Archive"};
|
option::PostfixText{"Extracting Archive"};
|
||||||
option::ForegroundColor{Color::GREEN};
|
option::ForegroundColor{Color::green};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update bar state
|
// Update bar state
|
||||||
@@ -115,7 +115,7 @@ int main() {
|
|||||||
option::Remainder{"-"},
|
option::Remainder{"-"},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::PostfixText{"Loading dependency 1/4"},
|
option::PostfixText{"Loading dependency 1/4"},
|
||||||
option::ForegroundColor{Color::CYAN}
|
option::ForegroundColor{Color::cyan}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update bar state
|
// Update bar state
|
||||||
@@ -173,8 +173,8 @@ int main() {
|
|||||||
option::Lead{"█"},
|
option::Lead{"█"},
|
||||||
option::Remainder{"-"},
|
option::Remainder{"-"},
|
||||||
option::End{"]"},
|
option::End{"]"},
|
||||||
option::PrefixText{"Training Gaze Network "},
|
option::PrefixText{"Training Gaze Network 👀"},
|
||||||
option::ForegroundColor{Color::YELLOW}
|
option::ForegroundColor{Color::yellow}
|
||||||
option::ShowElapsedTime{true};
|
option::ShowElapsedTime{true};
|
||||||
option::ShowRemainingTime{true};
|
option::ShowRemainingTime{true};
|
||||||
};
|
};
|
||||||
@@ -217,7 +217,7 @@ int main() {
|
|||||||
option::BarWidth{80},
|
option::BarWidth{80},
|
||||||
option::Start{"["},
|
option::Start{"["},
|
||||||
option::End{"]"},
|
option::End{"]"},
|
||||||
option::ForegroundColor{Color::WHITE}
|
option::ForegroundColor{Color::white}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update bar state
|
// Update bar state
|
||||||
@@ -263,7 +263,7 @@ int main() {
|
|||||||
option::Lead{"■"},
|
option::Lead{"■"},
|
||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::ForegroundColor{Color::YELLOW},
|
option::ForegroundColor{Color::yellow},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #1 "}
|
option::PrefixText{"Progress Bar #1 "}
|
||||||
@@ -278,7 +278,7 @@ int main() {
|
|||||||
option::Lead{">"},
|
option::Lead{">"},
|
||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::ForegroundColor{Color::CYAN},
|
option::ForegroundColor{Color::cyan},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #2 "}
|
option::PrefixText{"Progress Bar #2 "}
|
||||||
@@ -292,7 +292,7 @@ int main() {
|
|||||||
option::Lead{"#"},
|
option::Lead{"#"},
|
||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::ForegroundColor{Color::RED},
|
option::ForegroundColor{Color::red},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #3 "}
|
option::PrefixText{"Progress Bar #3 "}
|
||||||
@@ -363,7 +363,7 @@ int main() {
|
|||||||
using namespace indicators;
|
using namespace indicators;
|
||||||
indicators::ProgressSpinner spinner{
|
indicators::ProgressSpinner spinner{
|
||||||
option::PostfixText{"Checking credentials"},
|
option::PostfixText{"Checking credentials"},
|
||||||
option::ForegroundColor{Color::YELLOW},
|
option::ForegroundColor{Color::yellow},
|
||||||
option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}
|
option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ int main() {
|
|||||||
auto job = [&spinner]() {
|
auto job = [&spinner]() {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (spinner.is_completed()) {
|
if (spinner.is_completed()) {
|
||||||
spinner.set_option(option::ForegroundColor{Color::GREEN});
|
spinner.set_option(option::ForegroundColor{Color::green});
|
||||||
spinner.set_option(option::PrefixText{"✔"});
|
spinner.set_option(option::PrefixText{"✔"});
|
||||||
spinner.set_option(option::ShowSpinner{false});
|
spinner.set_option(option::ShowSpinner{false});
|
||||||
spinner.set_option(option::ShowPercentage{false});
|
spinner.set_option(option::ShowPercentage{false});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ int main() {
|
|||||||
option::Lead{"■"},
|
option::Lead{"■"},
|
||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::ForegroundColor{indicators::Color::YELLOW}};
|
option::ForegroundColor{indicators::Color::yellow}};
|
||||||
|
|
||||||
std::atomic<size_t> index{0};
|
std::atomic<size_t> index{0};
|
||||||
std::vector<std::string> status_text = {"Rocket.exe is not responding",
|
std::vector<std::string> status_text = {"Rocket.exe is not responding",
|
||||||
@@ -56,7 +56,7 @@ int main() {
|
|||||||
p.set_option(option::Lead{""});
|
p.set_option(option::Lead{""});
|
||||||
p.set_option(option::Remainder{""});
|
p.set_option(option::Remainder{""});
|
||||||
p.set_option(option::End{""});
|
p.set_option(option::End{""});
|
||||||
p.set_option(option::ForegroundColor{indicators::Color::WHITE});
|
p.set_option(option::ForegroundColor{indicators::Color::white});
|
||||||
p.set_option(option::ShowPercentage{false});
|
p.set_option(option::ShowPercentage{false});
|
||||||
auto job = [&p]() {
|
auto job = [&p]() {
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -86,7 +86,7 @@ int main() {
|
|||||||
p.set_option(option::Remainder{" "});
|
p.set_option(option::Remainder{" "});
|
||||||
p.set_option(option::End{"]"});
|
p.set_option(option::End{"]"});
|
||||||
p.set_option(option::PostfixText{"Getting started"});
|
p.set_option(option::PostfixText{"Getting started"});
|
||||||
p.set_option(option::ForegroundColor{indicators::Color::GREEN});
|
p.set_option(option::ForegroundColor{indicators::Color::green});
|
||||||
auto job = [&p]() {
|
auto job = [&p]() {
|
||||||
while (true) {
|
while (true) {
|
||||||
auto ticks = p.current();
|
auto ticks = p.current();
|
||||||
@@ -120,7 +120,7 @@ int main() {
|
|||||||
p4.set_option(option::Lead{""});
|
p4.set_option(option::Lead{""});
|
||||||
p4.set_option(option::Remainder{" "});
|
p4.set_option(option::Remainder{" "});
|
||||||
p4.set_option(option::End{""});
|
p4.set_option(option::End{""});
|
||||||
p4.set_option(option::ForegroundColor{indicators::Color::CYAN});
|
p4.set_option(option::ForegroundColor{indicators::Color::cyan});
|
||||||
p4.set_option(option::PostfixText{"Restoring system state"});
|
p4.set_option(option::PostfixText{"Restoring system state"});
|
||||||
p4.set_option(option::ShowPercentage{false});
|
p4.set_option(option::ShowPercentage{false});
|
||||||
std::atomic<size_t> index4{0};
|
std::atomic<size_t> index4{0};
|
||||||
@@ -131,7 +131,7 @@ int main() {
|
|||||||
index4 += 1;
|
index4 += 1;
|
||||||
if (p4.current() + 2 >= 100) {
|
if (p4.current() + 2 >= 100) {
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
p4.set_option(option::ForegroundColor{indicators::Color::RED});
|
p4.set_option(option::ForegroundColor{indicators::Color::red});
|
||||||
p4.set_option(option::PrefixText{"{ ERROR }"});
|
p4.set_option(option::PrefixText{"{ ERROR }"});
|
||||||
p4.set_option(option::Start{});
|
p4.set_option(option::Start{});
|
||||||
p4.set_option(option::Fill{});
|
p4.set_option(option::Fill{});
|
||||||
@@ -162,7 +162,7 @@ int main() {
|
|||||||
option::Lead{"■"},
|
option::Lead{"■"},
|
||||||
option::Remainder{"-"},
|
option::Remainder{"-"},
|
||||||
option::End{"]"},
|
option::End{"]"},
|
||||||
option::ForegroundColor{indicators::Color::WHITE},
|
option::ForegroundColor{indicators::Color::white},
|
||||||
option::PostfixText{"Reverting system restore"}
|
option::PostfixText{"Reverting system restore"}
|
||||||
};
|
};
|
||||||
p.set_progress(100); // TODO backwards as an option?
|
p.set_progress(100); // TODO backwards as an option?
|
||||||
@@ -191,14 +191,14 @@ int main() {
|
|||||||
indicators::ProgressSpinner p{
|
indicators::ProgressSpinner p{
|
||||||
option::PrefixText{""},
|
option::PrefixText{""},
|
||||||
option::PostfixText{"Checking credentials"},
|
option::PostfixText{"Checking credentials"},
|
||||||
option::ForegroundColor{indicators::Color::YELLOW},
|
option::ForegroundColor{indicators::Color::yellow},
|
||||||
option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}
|
option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto job = [&p]() {
|
auto job = [&p]() {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (p.is_completed()) {
|
if (p.is_completed()) {
|
||||||
p.set_option(option::ForegroundColor{indicators::Color::GREEN});
|
p.set_option(option::ForegroundColor{indicators::Color::green});
|
||||||
p.set_option(option::PrefixText{"✔"});
|
p.set_option(option::PrefixText{"✔"});
|
||||||
p.set_option(option::ShowSpinner{false});
|
p.set_option(option::ShowSpinner{false});
|
||||||
p.set_option(option::ShowPercentage{false});
|
p.set_option(option::ShowPercentage{false});
|
||||||
@@ -222,7 +222,7 @@ int main() {
|
|||||||
indicators::ProgressSpinner p{
|
indicators::ProgressSpinner p{
|
||||||
option::PrefixText{" - "},
|
option::PrefixText{" - "},
|
||||||
option::PostfixText{"Searching for the Moon"},
|
option::PostfixText{"Searching for the Moon"},
|
||||||
option::ForegroundColor{indicators::Color::WHITE},
|
option::ForegroundColor{indicators::Color::white},
|
||||||
option::ShowPercentage{false},
|
option::ShowPercentage{false},
|
||||||
option::SpinnerStates{std::vector<std::string>{"▖", "▘", "▝", "▗"}}
|
option::SpinnerStates{std::vector<std::string>{"▖", "▘", "▝", "▗"}}
|
||||||
};
|
};
|
||||||
@@ -270,7 +270,7 @@ int main() {
|
|||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{"🌑"},
|
option::End{"🌑"},
|
||||||
option::PostfixText{"Achieved low-Earth orbit"},
|
option::PostfixText{"Achieved low-Earth orbit"},
|
||||||
option::ForegroundColor{indicators::Color::WHITE}
|
option::ForegroundColor{indicators::Color::white}
|
||||||
};
|
};
|
||||||
std::vector<std::string> ship_trail{"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"};
|
std::vector<std::string> ship_trail{"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"};
|
||||||
std::atomic<int> ship_trail_index{0};
|
std::atomic<int> ship_trail_index{0};
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class BlockProgressBar {
|
|||||||
public:
|
public:
|
||||||
template <typename... Args, typename std::enable_if<details::are_settings_from_tuple<Settings, typename std::decay<Args>::type...>::value, void*>::type = nullptr>
|
template <typename... Args, typename std::enable_if<details::are_settings_from_tuple<Settings, typename std::decay<Args>::type...>::value, void*>::type = nullptr>
|
||||||
explicit BlockProgressBar(Args&&... args) : settings_(
|
explicit BlockProgressBar(Args&&... args) : settings_(
|
||||||
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::WHITE}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::white}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::bar_width>(option::BarWidth{100}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::bar_width>(option::BarWidth{100}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::start>(option::Start{"["}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::start>(option::Start{"["}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::end>(option::End{"]"}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::end>(option::End{"]"}, std::forward<Args>(args)...),
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ SOFTWARE.
|
|||||||
#include <indicators/termcolor.hpp>
|
#include <indicators/termcolor.hpp>
|
||||||
|
|
||||||
namespace indicators {
|
namespace indicators {
|
||||||
enum class Color { GREY, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };
|
enum class Color { grey, red, green, yellow, blue, magenta, cyan, white };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,28 +18,28 @@ namespace details {
|
|||||||
|
|
||||||
inline void set_stream_color(std::ostream &os, Color color) {
|
inline void set_stream_color(std::ostream &os, Color color) {
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case Color::GREY:
|
case Color::grey:
|
||||||
os << termcolor::grey;
|
os << termcolor::grey;
|
||||||
break;
|
break;
|
||||||
case Color::RED:
|
case Color::red:
|
||||||
os << termcolor::red;
|
os << termcolor::red;
|
||||||
break;
|
break;
|
||||||
case Color::GREEN:
|
case Color::green:
|
||||||
os << termcolor::green;
|
os << termcolor::green;
|
||||||
break;
|
break;
|
||||||
case Color::YELLOW:
|
case Color::yellow:
|
||||||
os << termcolor::yellow;
|
os << termcolor::yellow;
|
||||||
break;
|
break;
|
||||||
case Color::BLUE:
|
case Color::blue:
|
||||||
os << termcolor::blue;
|
os << termcolor::blue;
|
||||||
break;
|
break;
|
||||||
case Color::MAGENTA:
|
case Color::magenta:
|
||||||
os << termcolor::magenta;
|
os << termcolor::magenta;
|
||||||
break;
|
break;
|
||||||
case Color::CYAN:
|
case Color::cyan:
|
||||||
os << termcolor::cyan;
|
os << termcolor::cyan;
|
||||||
break;
|
break;
|
||||||
case Color::WHITE:
|
case Color::white:
|
||||||
os << termcolor::white;
|
os << termcolor::white;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public:
|
|||||||
details::get<details::ProgressBarOption::show_elapsed_time>(option::ShowElapsedTime{false}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::show_elapsed_time>(option::ShowElapsedTime{false}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::show_remaining_time>(option::ShowRemainingTime{false}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::show_remaining_time>(option::ShowRemainingTime{false}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::saved_start_time>(option::SavedStartTime{false}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::saved_start_time>(option::SavedStartTime{false}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::WHITE}, std::forward<Args>(args)...)
|
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::white}, std::forward<Args>(args)...)
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class ProgressSpinner {
|
|||||||
public:
|
public:
|
||||||
template <typename... Args, typename std::enable_if<details::are_settings_from_tuple<Settings, typename std::decay<Args>::type...>::value, void*>::type = nullptr>
|
template <typename... Args, typename std::enable_if<details::are_settings_from_tuple<Settings, typename std::decay<Args>::type...>::value, void*>::type = nullptr>
|
||||||
explicit ProgressSpinner(Args&&... args) : settings_(
|
explicit ProgressSpinner(Args&&... args) : settings_(
|
||||||
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::WHITE}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::white}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::prefix_text>(option::PrefixText{}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::prefix_text>(option::PrefixText{}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::postfix_text>(option::PostfixText{}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::postfix_text>(option::PostfixText{}, std::forward<Args>(args)...),
|
||||||
details::get<details::ProgressBarOption::show_percentage>(option::ShowPercentage{true}, std::forward<Args>(args)...),
|
details::get<details::ProgressBarOption::show_percentage>(option::ShowPercentage{true}, std::forward<Args>(args)...),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ int main() {
|
|||||||
using namespace indicators;
|
using namespace indicators;
|
||||||
BlockProgressBar bar1{
|
BlockProgressBar bar1{
|
||||||
option::BarWidth{50},
|
option::BarWidth{50},
|
||||||
option::ForegroundColor{Color::YELLOW},
|
option::ForegroundColor{Color::yellow},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #1 "}
|
option::PrefixText{"Progress Bar #1 "}
|
||||||
@@ -13,7 +13,7 @@ int main() {
|
|||||||
|
|
||||||
BlockProgressBar bar2{
|
BlockProgressBar bar2{
|
||||||
option::BarWidth{50},
|
option::BarWidth{50},
|
||||||
option::ForegroundColor{Color::CYAN},
|
option::ForegroundColor{Color::cyan},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #2 "}
|
option::PrefixText{"Progress Bar #2 "}
|
||||||
@@ -21,7 +21,7 @@ int main() {
|
|||||||
|
|
||||||
BlockProgressBar bar3{
|
BlockProgressBar bar3{
|
||||||
option::BarWidth{50},
|
option::BarWidth{50},
|
||||||
option::ForegroundColor{Color::RED},
|
option::ForegroundColor{Color::red},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #3 "}
|
option::PrefixText{"Progress Bar #3 "}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ int main() {
|
|||||||
indicators::option::Lead{"■"},
|
indicators::option::Lead{"■"},
|
||||||
indicators::option::Remainder{" "},
|
indicators::option::Remainder{" "},
|
||||||
indicators::option::End{" ]"},
|
indicators::option::End{" ]"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::YELLOW},
|
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||||
indicators::option::ShowElapsedTime{true},
|
indicators::option::ShowElapsedTime{true},
|
||||||
indicators::option::ShowRemainingTime{true},
|
indicators::option::ShowRemainingTime{true},
|
||||||
indicators::option::PrefixText{"Progress Bar #1 "}
|
indicators::option::PrefixText{"Progress Bar #1 "}
|
||||||
@@ -23,7 +23,7 @@ int main() {
|
|||||||
indicators::option::Lead{">"},
|
indicators::option::Lead{">"},
|
||||||
indicators::option::Remainder{" "},
|
indicators::option::Remainder{" "},
|
||||||
indicators::option::End{" ]"},
|
indicators::option::End{" ]"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::CYAN},
|
indicators::option::ForegroundColor{indicators::Color::cyan},
|
||||||
indicators::option::ShowElapsedTime{true},
|
indicators::option::ShowElapsedTime{true},
|
||||||
indicators::option::ShowRemainingTime{true},
|
indicators::option::ShowRemainingTime{true},
|
||||||
indicators::option::PrefixText{"Progress Bar #2 "}
|
indicators::option::PrefixText{"Progress Bar #2 "}
|
||||||
@@ -36,7 +36,7 @@ int main() {
|
|||||||
indicators::option::Lead{"#"},
|
indicators::option::Lead{"#"},
|
||||||
indicators::option::Remainder{" "},
|
indicators::option::Remainder{" "},
|
||||||
indicators::option::End{" ]"},
|
indicators::option::End{" ]"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::RED},
|
indicators::option::ForegroundColor{indicators::Color::red},
|
||||||
indicators::option::ShowElapsedTime{true},
|
indicators::option::ShowElapsedTime{true},
|
||||||
indicators::option::ShowRemainingTime{true},
|
indicators::option::ShowRemainingTime{true},
|
||||||
indicators::option::PrefixText{"Progress Bar #3 "}
|
indicators::option::PrefixText{"Progress Bar #3 "}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ int main() {
|
|||||||
indicators::option::Lead{"■"},
|
indicators::option::Lead{"■"},
|
||||||
indicators::option::Remainder{"-"},
|
indicators::option::Remainder{"-"},
|
||||||
indicators::option::End{" ]"},
|
indicators::option::End{" ]"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::YELLOW},
|
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||||
};
|
};
|
||||||
|
|
||||||
// As configured, the bar will look like this:
|
// As configured, the bar will look like this:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ int main() {
|
|||||||
indicators::option::Remainder{"-"},
|
indicators::option::Remainder{"-"},
|
||||||
indicators::option::End{" ]"},
|
indicators::option::End{" ]"},
|
||||||
indicators::option::PostfixText{"Loading dependency 1/4"},
|
indicators::option::PostfixText{"Loading dependency 1/4"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::CYAN},
|
indicators::option::ForegroundColor{indicators::Color::cyan},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update bar state
|
// Update bar state
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main() {
|
|||||||
indicators::option::Remainder{" "},
|
indicators::option::Remainder{" "},
|
||||||
indicators::option::End{" ]"},
|
indicators::option::End{" ]"},
|
||||||
indicators::option::PostfixText{"Getting started"},
|
indicators::option::PostfixText{"Getting started"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::GREEN},
|
indicators::option::ForegroundColor{indicators::Color::green},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update bar state
|
// Update bar state
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ int main() {
|
|||||||
|
|
||||||
indicators::ProgressSpinner spinner{
|
indicators::ProgressSpinner spinner{
|
||||||
indicators::option::PostfixText{"Checking credentials"},
|
indicators::option::PostfixText{"Checking credentials"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::YELLOW},
|
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||||
indicators::option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}},
|
indicators::option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ int main() {
|
|||||||
auto job = [&spinner]() {
|
auto job = [&spinner]() {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (spinner.is_completed()) {
|
if (spinner.is_completed()) {
|
||||||
spinner.set_option(indicators::option::ForegroundColor{indicators::Color::GREEN});
|
spinner.set_option(indicators::option::ForegroundColor{indicators::Color::green});
|
||||||
spinner.set_option(indicators::option::PrefixText{"✔"});
|
spinner.set_option(indicators::option::PrefixText{"✔"});
|
||||||
spinner.set_option(indicators::option::ShowSpinner{false});
|
spinner.set_option(indicators::option::ShowSpinner{false});
|
||||||
spinner.set_option(indicators::option::ShowPercentage{false});
|
spinner.set_option(indicators::option::ShowPercentage{false});
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ int main() {
|
|||||||
indicators::option::Lead{"█"},
|
indicators::option::Lead{"█"},
|
||||||
indicators::option::Remainder{"-"},
|
indicators::option::Remainder{"-"},
|
||||||
indicators::option::End{"]"},
|
indicators::option::End{"]"},
|
||||||
indicators::option::PostfixText{"Training Gaze Network "},
|
indicators::option::PrefixText{"Training Gaze Network 👀"},
|
||||||
indicators::option::ForegroundColor{indicators::Color::YELLOW},
|
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||||
indicators::option::ShowElapsedTime{true},
|
indicators::option::ShowElapsedTime{true},
|
||||||
indicators::option::ShowRemainingTime{true},
|
indicators::option::ShowRemainingTime{true},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user