use modcli::output::print;
use modcli::output::progress::{ProgressBar, ProgressStyle};
use std::time::Duration;
fn main() {
print::line("Real progress driven by work:");
let total_chunks = 50;
let mut bar = ProgressBar::new(total_chunks, ProgressStyle::default());
bar.set_label("Downloading");
let simulated_chunk_times_ms: Vec<u64> = (0..total_chunks)
.map(|i| 10 + ((i * 13) % 25) as u64) .collect();
for (i, delay) in simulated_chunk_times_ms.into_iter().enumerate() {
std::thread::sleep(Duration::from_millis(delay));
bar.set_progress(i + 1);
}
println!(" {}", bar.style.done_label);
}