diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/source.rs | 16 | ||||
-rw-r--r-- | src/orchestrator/orchestrator.rs | 8 | ||||
-rw-r--r-- | src/util/progress.rs | 5 |
3 files changed, 25 insertions, 4 deletions
diff --git a/src/commands/source.rs b/src/commands/source.rs index 8b1cf3e..f29ce84 100644 --- a/src/commands/source.rs +++ b/src/commands/source.rs @@ -86,7 +86,13 @@ pub(in crate::commands) async fn verify_impl<'a, I>( where I: Iterator<Item = &'a Package> + 'a, { - let multi = Arc::new(indicatif::MultiProgress::new()); + let multi = Arc::new({ + let mp = indicatif::MultiProgress::new(); + if progressbars.hide() { + mp.set_draw_target(indicatif::ProgressDrawTarget::hidden()); + } + mp + }); let results = packages .map(|p| sc.sources_for(p).into_iter()) @@ -222,7 +228,13 @@ pub async fn download( .map(String::from) .map(PackageVersionConstraint::new) .transpose()?; - let multi = indicatif::MultiProgress::new(); + let multi = { + let mp = indicatif::MultiProgress::new(); + if progressbars.hide() { + mp.set_draw_target(indicatif::ProgressDrawTarget::hidden()); + } + mp + }; let r = repo .packages() diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index 51c6d9a..de50b36 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -216,7 +216,13 @@ impl<'a> Orchestrator<'a> { } async fn run_tree(self) -> Result<(Vec<ArtifactPath>, HashMap<Uuid, Error>)> { - let multibar = Arc::new(indicatif::MultiProgress::new()); + let multibar = Arc::new({ + let mp = indicatif::MultiProgress::new(); + if self.progress_generator.hide() { + mp.set_draw_target(indicatif::ProgressDrawTarget::hidden()); + } + mp + }); // For each job in the jobdag, built a tuple with // diff --git a/src/util/progress.rs b/src/util/progress.rs index 01def42..b2edc08 100644 --- a/src/util/progress.rs +++ b/src/util/progress.rs @@ -9,11 +9,14 @@ // use indicatif::*; +use getset::CopyGetters; -#[derive(Clone, Debug)] +#[derive(Clone, Debug, CopyGetters)] pub struct ProgressBars { bar_template: String, spinner_template: String, + + #[getset(get_copy = "pub")] hide: bool, } |