prune,ui,docs: color the digest, add -f/--force and a sizing spinner

- -f/--force skips the size pass and the confirmation prompt: remove
  immediately, reporting counts but no sizes. The fastest cleanup
  path; --dry-run still previews.
- The default path shows the grouped digest and asks before removing
  (the raw-mode yes/no prompt; non-interactive sessions keep their
  headless path, so scripts reach for --force).
- Sizes are computed under a spinner ("Computing sizes of
  directories to prune..."), and the digest colors the counts (bold)
  and the sizes (cyan) on terminals only.
This commit is contained in:
2026-10-02 23:43:04 +02:00
parent 74c74f0a61
commit b85a377b24
4 changed files with 231 additions and 82 deletions
+11
View File
@@ -40,6 +40,17 @@ pub(crate) fn transfer_style() -> ProgressStyle {
.progress_chars("=> ")
}
/// A standalone spinner for one-line waits outside a build view (the
/// prune size pass): braille frames over the message, drawn only on
/// terminals. Callers finish it with [`ProgressBar::finish_and_clear`].
pub fn wait_spinner(msg: &str) -> ProgressBar {
let pb = ProgressBar::new_spinner();
pb.set_style(ProgressStyle::with_template("{spinner:.blue} {msg}").expect("spinner template"));
pb.set_message(msg.to_string());
pb.enable_steady_tick(Duration::from_millis(120));
pb
}
/// Create a spinner-style progress bar attached to `multi`, returning the bar
/// and a callback compatible with [`crate::ProgressCallback`]
pub fn create_progress_bar(