deb: shorten the staged-tree copy progress label
The live view's bar template renders the byte counters after the bar, so baking them into the message too duplicated them and pushed the line past the terminal width. Announce the copy as "Restoring <id>" and leave the counters to the view.
This commit is contained in:
+5
-9
@@ -821,16 +821,12 @@ fn copy_report<'a>(
|
||||
base_id: &str,
|
||||
) -> Option<Box<dyn Fn(u64, u64) + Sync + 'a>> {
|
||||
view.map(|view| {
|
||||
let label = format!("Copying the staged tree of record {base_id}");
|
||||
// The views render the byte counters after the bar: the label
|
||||
// must stay short or the bar line overflows a narrow terminal.
|
||||
let label = format!("Restoring {base_id}");
|
||||
view.message(&label);
|
||||
Box::new(move |pos: u64, total: u64| {
|
||||
let size = crate::utils::size::format_bytes;
|
||||
view.byte_progress(
|
||||
&format!("{label} ({}/{})", size(pos), size(total)),
|
||||
pos,
|
||||
total,
|
||||
)
|
||||
}) as Box<dyn Fn(u64, u64) + Sync + 'a>
|
||||
Box::new(move |pos: u64, total: u64| view.byte_progress(&label, pos, total))
|
||||
as Box<dyn Fn(u64, u64) + Sync + 'a>
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user