Skip to content

Commit 7ac6f53

Browse files
committed
Code review fixes
1 parent ed9ec38 commit 7ac6f53

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

src/doc/man/includes/options-display.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ May also be specified with the `term.verbose`
77

88
{{#option "`-q`" "`--quiet`"}}
99
Do not print cargo log messages.
10+
May also be specified with the `term.quiet`
11+
[config value](../reference/config.html).
1012
{{/option}}
1113

1214
{{#option "`--color` _when_"}}

src/doc/src/reference/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ metadata_key1 = "value"
168168
metadata_key2 = "value"
169169

170170
[term]
171+
quiet = false # whether cargo output is quiet
171172
verbose = false # whether cargo provides verbose output
172173
color = 'auto' # whether cargo colorizes output
173174
progress.when = 'auto' # whether cargo shows progress bar

src/doc/src/reference/environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ supported environment variables are:
114114
* `CARGO_TARGET_<triple>_LINKER` — The linker to use, see [`target.<triple>.linker`]. The triple must be [converted to uppercase and underscores](config.md#environment-variables).
115115
* `CARGO_TARGET_<triple>_RUNNER` — The executable runner, see [`target.<triple>.runner`].
116116
* `CARGO_TARGET_<triple>_RUSTFLAGS` — Extra `rustc` flags for a target, see [`target.<triple>.rustflags`].
117+
* `CARGO_TERM_QUIET` — Quiet mode, see [`term.quiet`].
117118
* `CARGO_TERM_VERBOSE` — The default terminal verbosity, see [`term.verbose`].
118119
* `CARGO_TERM_COLOR` — The default color mode, see [`term.color`].
119120
* `CARGO_TERM_PROGRESS_WHEN` — The default progress bar showing mode, see [`term.progress.when`].

tests/testsuite/run.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ fn quiet_arg() {
2727
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
2828
.build();
2929

30-
p.cargo("build -q")
31-
.with_stderr_does_not_contain("[FINISHED] [..]")
32-
.run();
30+
p.cargo("run -q").with_stderr("").with_stdout("hello").run();
3331

34-
p.cargo("build --quiet")
35-
.with_stderr_does_not_contain("[FINISHED] [..]")
32+
p.cargo("run --quiet")
33+
.with_stderr("")
34+
.with_stdout("hello")
3635
.run();
3736
}
3837

@@ -42,7 +41,7 @@ fn quiet_arg_and_verbose_arg() {
4241
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
4342
.build();
4443

45-
p.cargo("build -q -v")
44+
p.cargo("run -q -v")
4645
.with_status(101)
4746
.with_stderr("[ERROR] cannot set both --verbose and --quiet")
4847
.run();
@@ -61,9 +60,7 @@ fn quiet_arg_and_verbose_config() {
6160
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
6261
.build();
6362

64-
p.cargo("build -q")
65-
.with_stderr_does_not_contain("[FINISHED] [..]")
66-
.run();
63+
p.cargo("run -q").with_stderr("").with_stdout("hello").run();
6764
}
6865

6966
#[cargo_test]
@@ -79,8 +76,15 @@ fn verbose_arg_and_quiet_config() {
7976
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
8077
.build();
8178

82-
p.cargo("build -v")
83-
.with_stderr_contains("[RUNNING] `rustc [..]")
79+
p.cargo("run -v")
80+
.with_stderr(
81+
"\
82+
[COMPILING] foo v0.0.1 ([CWD])
83+
[RUNNING] `rustc [..]
84+
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
85+
[RUNNING] `target/debug/foo[EXE]`",
86+
)
87+
.with_stdout("hello")
8488
.run();
8589
}
8690

@@ -98,7 +102,7 @@ fn quiet_config_and_verbose_config() {
98102
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
99103
.build();
100104

101-
p.cargo("build")
105+
p.cargo("run")
102106
.with_status(101)
103107
.with_stderr("[ERROR] cannot set both `term.verbose` and `term.quiet`")
104108
.run();

0 commit comments

Comments
 (0)