Skip to content

Commit 4f6b265

Browse files
committed
Auto merge of #4826 - alexcrichton:silence-progress, r=matklad
Don't print a progress bar in quiet mode Closes #4825
2 parents d85b020 + 4ce7319 commit 4f6b265

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cargo/util/progress.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::cmp;
22
use std::iter;
33
use std::time::{Instant, Duration};
44

5+
use core::shell::Verbosity;
56
use util::{Config, CargoResult};
67

78
pub struct Progress<'cfg> {
@@ -19,6 +20,11 @@ struct State<'cfg> {
1920

2021
impl<'cfg> Progress<'cfg> {
2122
pub fn new(name: &str, cfg: &'cfg Config) -> Progress<'cfg> {
23+
// no progress if `-q` is passed as, well, we're supposed to be quiet
24+
if cfg.shell().verbosity() == Verbosity::Quiet {
25+
return Progress { state: None }
26+
}
27+
2228
Progress {
2329
state: cfg.shell().err_width().map(|n| {
2430
State {

0 commit comments

Comments
 (0)