Closed lnicola closed 1 year ago
Right, I suppose the API is a little confusing. with_message()
sets a message, but the message only shows up if you're using a template that includes a {message}
field. Want to submit a documentation clarification PR?
So something like
use std::{thread, time::Duration};
use indicatif::{ProgressBar, ProgressStyle};
fn main() {
let style = ProgressStyle::with_template("{message} {wide_bar} {pos}/{len}")
.expect("compile-time constant");
let pb = ProgressBar::new(100)
.with_style(style)
.with_message("Frobbing the widget");
for _ in 0..100 {
thread::sleep(Duration::from_millis(30));
pb.inc(1);
}
}
?
Yup!
But it still doesn't show up :smile:.
But it still doesn't show up 😄.
Instead of {message}
, it should be {msg}
I couldn't find an example or an existing issue about this. What does the message do?
Minimal example: