mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
Truncate long messages in the progress bar (#214)
* Truncate long messages in the progress bar
This commit is contained in:
parent
add6a595bd
commit
a3d3e5d1d9
@ -63,9 +63,9 @@ impl Progress {
|
|||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
let template = {
|
let template = {
|
||||||
let mut t = String::new();
|
let mut t = String::new();
|
||||||
t += "{prefix} [{elapsed_precise}] ";
|
t += "{wide_msg} [{elapsed_precise}] ";
|
||||||
if precise && current_position_fn.is_some() {
|
if precise && current_position_fn.is_some() {
|
||||||
t += "[{wide_bar:.cyan/blue}] ";
|
t += "[{bar:.cyan/blue}] ";
|
||||||
} else {
|
} else {
|
||||||
t += "{spinner:.green} ";
|
t += "{spinner:.green} ";
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ impl Progress {
|
|||||||
pb.tick();
|
pb.tick();
|
||||||
}
|
}
|
||||||
if let Ok(msg) = msg_rx.try_recv() {
|
if let Ok(msg) = msg_rx.try_recv() {
|
||||||
pb.set_prefix(msg);
|
pb.set_message(msg);
|
||||||
}
|
}
|
||||||
thread::sleep(Duration::from_millis(100));
|
thread::sleep(Duration::from_millis(100));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user