mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-16 04:18:51 +08:00
Update examples, add percentage to match actual behavior
This commit is contained in:
11
README.md
11
README.md
@@ -80,6 +80,7 @@ int main() {
|
|||||||
option::End{"]"},
|
option::End{"]"},
|
||||||
option::PostfixText{"Extracting Archive"},
|
option::PostfixText{"Extracting Archive"},
|
||||||
option::ForegroundColor{Color::green},
|
option::ForegroundColor{Color::green},
|
||||||
|
option::ShowPercentage{true},
|
||||||
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}
|
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -127,8 +128,8 @@ int main() {
|
|||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::PostfixText{"Loading dependency 1/4"},
|
option::PostfixText{"Loading dependency 1/4"},
|
||||||
option::ForegroundColor{Color::cyan},
|
option::ForegroundColor{Color::cyan},
|
||||||
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}
|
option::ShowPercentage{true},
|
||||||
};
|
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}} };
|
||||||
|
|
||||||
// Update bar state
|
// Update bar state
|
||||||
bar.set_progress(10); // 10% done
|
bar.set_progress(10); // 10% done
|
||||||
@@ -190,6 +191,7 @@ int main() {
|
|||||||
option::End{"]"},
|
option::End{"]"},
|
||||||
option::PrefixText{"Training Gaze Network 👀"},
|
option::PrefixText{"Training Gaze Network 👀"},
|
||||||
option::ForegroundColor{Color::yellow},
|
option::ForegroundColor{Color::yellow},
|
||||||
|
option::ShowPercentage{true},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}
|
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}
|
||||||
@@ -291,6 +293,7 @@ int main() {
|
|||||||
option::Start{"["},
|
option::Start{"["},
|
||||||
option::End{"]"},
|
option::End{"]"},
|
||||||
option::ForegroundColor{Color::white} ,
|
option::ForegroundColor{Color::white} ,
|
||||||
|
option::ShowPercentage{true},
|
||||||
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}
|
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -340,6 +343,7 @@ int main() {
|
|||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::ForegroundColor{Color::yellow},
|
option::ForegroundColor{Color::yellow},
|
||||||
|
option::ShowPercentage{true},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #1 "},
|
option::PrefixText{"Progress Bar #1 "},
|
||||||
@@ -356,6 +360,7 @@ int main() {
|
|||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::ForegroundColor{Color::cyan},
|
option::ForegroundColor{Color::cyan},
|
||||||
|
option::ShowPercentage{true},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #2 "},
|
option::PrefixText{"Progress Bar #2 "},
|
||||||
@@ -371,6 +376,7 @@ int main() {
|
|||||||
option::Remainder{" "},
|
option::Remainder{" "},
|
||||||
option::End{" ]"},
|
option::End{" ]"},
|
||||||
option::ForegroundColor{Color::red},
|
option::ForegroundColor{Color::red},
|
||||||
|
option::ShowPercentage{true},
|
||||||
option::ShowElapsedTime{true},
|
option::ShowElapsedTime{true},
|
||||||
option::ShowRemainingTime{true},
|
option::ShowRemainingTime{true},
|
||||||
option::PrefixText{"Progress Bar #3 "},
|
option::PrefixText{"Progress Bar #3 "},
|
||||||
@@ -723,6 +729,7 @@ int main() {
|
|||||||
BlockProgressBar bar{
|
BlockProgressBar bar{
|
||||||
option::BarWidth{80},
|
option::BarWidth{80},
|
||||||
option::ForegroundColor{Color::white},
|
option::ForegroundColor{Color::white},
|
||||||
|
option::ShowPercentage{true},
|
||||||
option::FontStyles{
|
option::FontStyles{
|
||||||
std::vector<FontStyle>{FontStyle::bold}},
|
std::vector<FontStyle>{FontStyle::bold}},
|
||||||
option::MaxProgress{numbers.size()}
|
option::MaxProgress{numbers.size()}
|
||||||
|
|||||||
Reference in New Issue
Block a user