summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-07 00:10:59 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-07 00:10:59 -0500
commit2a39ca78354c5acb82ae1f4edb68ef6c2f0f2b03 (patch)
treea196d2106f79c2d33d86f049d6fcdad8168103f1 /src
parent3f4a6ec11e55a1d5634ba24e2dfd32d9e1d70d65 (diff)
downloadlastfm-query-2a39ca78354c5acb82ae1f4edb68ef6c2f0f2b03.tar.gz
lastfm-query-2a39ca78354c5acb82ae1f4edb68ef6c2f0f2b03.zip
switch to indicatif
Diffstat (limited to 'src')
-rw-r--r--src/main.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index ac8e5f8..3434827 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,6 @@
extern crate directories;
extern crate failure;
-extern crate pbr;
+extern crate indicatif;
extern crate reqwest;
extern crate rusqlite;
extern crate serde;
@@ -29,10 +29,16 @@ fn main() {
let to_fetch = exporter.tracks_to_sync().unwrap();
println!("need to download {} tracks", to_fetch);
- let mut bar = pbr::ProgressBar::new(to_fetch);
- exporter.sync(|_| { bar.inc(); })
+ let bar = indicatif::ProgressBar::new(to_fetch);
+ bar.set_style(
+ indicatif::ProgressStyle::default_bar()
+ .progress_chars("=> ")
+ .template("{percent:>3}% [{wide_bar}] {eta:5}")
+ );
+
+ exporter.sync(|_| { bar.inc(1); })
.expect("failed to update db");
- bar.finish_print("done");
+ bar.finish_with_message("done");
}