How to Add Progress Bars to Rust CLIs (indicatif)

Cli
Add the `indicatif` crate to your `Cargo.toml`, import it, and instantiate a `ProgressBar` to track iterations.

How to Add Progress Bars to Rust CLIs (indicatif)

Add the indicatif crate to your Cargo.toml, import it, and instantiate a ProgressBar to track iterations.

[dependencies]
indicatif = "0.17"
use indicatif::ProgressBar;

fn main() {
    let pb = ProgressBar::new(100);
    for i in 0..100 {
        // Your work here
        pb.inc(1);
    }
    pb.finish();
}