diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-12-09 13:31:23 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-12-09 14:52:09 +0100 |
commit | 4899ec32f152b8b598d67360e68e9054bfa1bdf6 (patch) | |
tree | 0d1eb410b16b2fa97cbe3f7cbc57c108d43b2f92 /src/config | |
parent | 92364867ff01c66ccb4bd7de6634ed721af5ab09 (diff) |
Make ProgressBars helper able to create spinners
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/not_validated.rs | 4 | ||||
-rw-r--r-- | src/config/util.rs | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/config/not_validated.rs b/src/config/not_validated.rs index 84ad993..d8a4d8d 100644 --- a/src/config/not_validated.rs +++ b/src/config/not_validated.rs @@ -23,6 +23,10 @@ pub struct NotValidatedConfiguration { #[getset(get = "pub")] progress_format: String, + #[serde(default = "default_spinner_format")] + #[getset(get = "pub")] + spinner_format: String, + #[serde(default = "default_package_print_format")] #[getset(get = "pub")] package_print_format: String, diff --git a/src/config/util.rs b/src/config/util.rs index 052899f..bf7e542 100644 --- a/src/config/util.rs +++ b/src/config/util.rs @@ -2,6 +2,10 @@ pub fn default_progress_format() -> String { String::from("[{elapsed_precise}] ({percent:>3}%): {bar:40.cyan/blue} | {msg}") } +pub fn default_spinner_format() -> String { + String::from("[{elapsed_precise}] {spinner} | {msg}") +} + pub fn default_package_print_format() -> String { String::from(indoc::indoc!(r#" {{i}} - {{p.name}} : {{p.version}} |