mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-08 05:30:22 +08:00
Fixed build
This commit is contained in:
@@ -7,7 +7,11 @@ int main() {
|
||||
// Hide cursor
|
||||
std::cout << "\e[?25l";
|
||||
|
||||
indicators::BlockProgressBar bar{indicators::option::BarWidth{80}};
|
||||
indicators::BlockProgressBar bar{
|
||||
indicators::option::BarWidth{80},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}
|
||||
};
|
||||
|
||||
// Update bar state
|
||||
auto progress = 0.0f;
|
||||
|
||||
@@ -6,27 +6,39 @@ int main() {
|
||||
|
||||
ProgressBar bar1{option::BarWidth{50}, option::ForegroundColor{Color::red},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"5c90d4a2d1a8: Downloading "}};
|
||||
option::PrefixText{"5c90d4a2d1a8: Downloading "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
ProgressBar bar2{option::BarWidth{50}, option::ForegroundColor{Color::yellow},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"22337bfd13a9: Downloading "}};
|
||||
option::PrefixText{"22337bfd13a9: Downloading "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
ProgressBar bar3{option::BarWidth{50}, option::ForegroundColor{Color::green},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"10f26c680a34: Downloading "}};
|
||||
option::PrefixText{"10f26c680a34: Downloading "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
ProgressBar bar4{option::BarWidth{50}, option::ForegroundColor{Color::white},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"6364e0d7a283: Downloading "}};
|
||||
option::PrefixText{"6364e0d7a283: Downloading "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
ProgressBar bar5{option::BarWidth{50}, option::ForegroundColor{Color::blue},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"ff1356ba118b: Downloading "}};
|
||||
option::PrefixText{"ff1356ba118b: Downloading "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
ProgressBar bar6{option::BarWidth{50}, option::ForegroundColor{Color::cyan},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"5a17453338b4: Downloading "}};
|
||||
option::PrefixText{"5a17453338b4: Downloading "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
std::cout << termcolor::bold << termcolor::white << "Pulling image foo:bar/baz\n";
|
||||
|
||||
|
||||
@@ -5,15 +5,21 @@ int main() {
|
||||
using namespace indicators;
|
||||
BlockProgressBar bar1{option::BarWidth{50}, option::ForegroundColor{Color::yellow},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"Progress Bar #1 "}};
|
||||
option::PrefixText{"Progress Bar #1 "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
BlockProgressBar bar2{option::BarWidth{50}, option::ForegroundColor{Color::cyan},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"Progress Bar #2 "}};
|
||||
option::PrefixText{"Progress Bar #2 "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
BlockProgressBar bar3{option::BarWidth{50}, option::ForegroundColor{Color::red},
|
||||
option::ShowElapsedTime{true}, option::ShowRemainingTime{true},
|
||||
option::PrefixText{"Progress Bar #3 "}};
|
||||
option::PrefixText{"Progress Bar #3 "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
indicators::MultiProgress<indicators::BlockProgressBar, 3> bars(bar1, bar2, bar3);
|
||||
|
||||
|
||||
@@ -12,7 +12,9 @@ int main() {
|
||||
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||
indicators::option::ShowElapsedTime{true},
|
||||
indicators::option::ShowRemainingTime{true},
|
||||
indicators::option::PrefixText{"Progress Bar #1 "}};
|
||||
indicators::option::PrefixText{"Progress Bar #1 "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
indicators::ProgressBar bar2{indicators::option::BarWidth{50},
|
||||
indicators::option::Start{"["},
|
||||
@@ -23,7 +25,9 @@ int main() {
|
||||
indicators::option::ForegroundColor{indicators::Color::cyan},
|
||||
indicators::option::ShowElapsedTime{true},
|
||||
indicators::option::ShowRemainingTime{true},
|
||||
indicators::option::PrefixText{"Progress Bar #2 "}};
|
||||
indicators::option::PrefixText{"Progress Bar #2 "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
indicators::ProgressBar bar3{indicators::option::BarWidth{50},
|
||||
indicators::option::Start{"["},
|
||||
@@ -34,7 +38,9 @@ int main() {
|
||||
indicators::option::ForegroundColor{indicators::Color::red},
|
||||
indicators::option::ShowElapsedTime{true},
|
||||
indicators::option::ShowRemainingTime{true},
|
||||
indicators::option::PrefixText{"Progress Bar #3 "}};
|
||||
indicators::option::PrefixText{"Progress Bar #3 "},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
|
||||
|
||||
indicators::MultiProgress<indicators::ProgressBar, 3> bars(bar1, bar2, bar3);
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ int main() {
|
||||
indicators::option::Remainder{"-"},
|
||||
indicators::option::End{" ]"},
|
||||
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}
|
||||
};
|
||||
|
||||
// As configured, the bar will look like this:
|
||||
|
||||
@@ -16,6 +16,8 @@ int main() {
|
||||
indicators::option::End{" ]"},
|
||||
indicators::option::PostfixText{"Loading dependency 1/4"},
|
||||
indicators::option::ForegroundColor{indicators::Color::cyan},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}
|
||||
};
|
||||
|
||||
// Update bar state
|
||||
|
||||
@@ -12,7 +12,8 @@ int main() {
|
||||
indicators::option::End{" ]"},
|
||||
indicators::option::PostfixText{"Getting started"},
|
||||
indicators::option::ForegroundColor{indicators::Color::green},
|
||||
indicators::option::FontStyles{std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}
|
||||
};
|
||||
|
||||
// Update bar state
|
||||
|
||||
@@ -10,6 +10,8 @@ int main() {
|
||||
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||
indicators::option::SpinnerStates{
|
||||
std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}
|
||||
};
|
||||
|
||||
// Update spinner state
|
||||
|
||||
@@ -14,6 +14,8 @@ int main() {
|
||||
indicators::option::ForegroundColor{indicators::Color::yellow},
|
||||
indicators::option::ShowElapsedTime{true},
|
||||
indicators::option::ShowRemainingTime{true},
|
||||
indicators::option::FontStyles{
|
||||
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}
|
||||
};
|
||||
|
||||
// Update bar state
|
||||
|
||||
Reference in New Issue
Block a user