summaryrefslogtreecommitdiff
path: root/cli/util/progress_bar/mod.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-08-14 12:04:07 +0100
committerGitHub <noreply@github.com>2024-08-14 13:04:07 +0200
commitb325bf0a35baea1275f3be89506e34040bf35b21 (patch)
tree70708a25471f18b9ce0c2d83d76ca1b1d0fd60e4 /cli/util/progress_bar/mod.rs
parent2f82873a88cbaea4ebe8e39b5aa7b57ed867512e (diff)
feat(clean): add progress bar (#25026)
Closes https://github.com/denoland/deno/issues/25020
Diffstat (limited to 'cli/util/progress_bar/mod.rs')
-rw-r--r--cli/util/progress_bar/mod.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/cli/util/progress_bar/mod.rs b/cli/util/progress_bar/mod.rs
index 91bf4950f..85be056d8 100644
--- a/cli/util/progress_bar/mod.rs
+++ b/cli/util/progress_bar/mod.rs
@@ -28,6 +28,7 @@ pub enum ProgressMessagePrompt {
Download,
Blocking,
Initialize,
+ Cleaning,
}
impl ProgressMessagePrompt {
@@ -38,6 +39,7 @@ impl ProgressMessagePrompt {
ProgressMessagePrompt::Initialize => {
colors::green("Initialize").to_string()
}
+ ProgressMessagePrompt::Cleaning => colors::green("Cleaning").to_string(),
}
}
}
@@ -71,7 +73,13 @@ impl UpdateGuard {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ProgressBarStyle {
+ /// Shows a progress bar with human readable download size
DownloadBars,
+
+ /// Shows a progress bar with numeric progres count
+ ProgressBars,
+
+ /// Shows a list of currently downloaded files.
TextOnly,
}
@@ -270,7 +278,14 @@ impl ProgressBar {
Self {
inner: ProgressBarInner::new(match style {
ProgressBarStyle::DownloadBars => {
- Arc::new(renderer::BarProgressBarRenderer)
+ Arc::new(renderer::BarProgressBarRenderer {
+ display_human_download_size: true,
+ })
+ }
+ ProgressBarStyle::ProgressBars => {
+ Arc::new(renderer::BarProgressBarRenderer {
+ display_human_download_size: false,
+ })
}
ProgressBarStyle::TextOnly => {
Arc::new(renderer::TextOnlyProgressBarRenderer::default())