Auto merge of #10152 - steven-joruk:quiet-config, r=ehuss

Support `term.quiet` configuration

Fixes #10128

This follows the existing support for `--verbose` and `term.verbose`.

I've renamed the related tests to be a bit clearer now there are more cases, and the existing quiet tests now prove that they hide the cargo log.

I'm unsure whether I'm supposed to regenerate the documentation as part of this?
This commit is contained in:
bors 2021-12-14 18:40:22 +00:00
commit a359ce1607
96 changed files with 333 additions and 80 deletions

View File

@ -909,20 +909,19 @@ impl Config {
let color = color.or_else(|| term.color.as_deref());
let verbosity = match (verbose, term.verbose, quiet) {
(true, _, false) | (_, Some(true), false) => Verbosity::Verbose,
// Command line takes precedence over configuration, so ignore the
// configuration..
(false, _, true) => Verbosity::Quiet,
// Can't pass both at the same time on the command line regardless
// of configuration.
(true, _, true) => {
bail!("cannot set both --verbose and --quiet");
}
(false, _, false) => Verbosity::Normal,
// The command line takes precedence over configuration.
let verbosity = match (verbose, quiet) {
(true, true) => bail!("cannot set both --verbose and --quiet"),
(true, false) => Verbosity::Verbose,
(false, true) => Verbosity::Quiet,
(false, false) => match (term.verbose, term.quiet) {
(Some(true), Some(true)) => {
bail!("cannot set both `term.verbose` and `term.quiet`")
}
(Some(true), Some(false)) => Verbosity::Verbose,
(Some(false), Some(true)) => Verbosity::Quiet,
_ => Verbosity::Normal,
},
};
let cli_target_dir = target_dir.as_ref().map(|dir| Filesystem::new(dir.clone()));
@ -2127,6 +2126,7 @@ pub struct CargoBuildConfig {
#[derive(Deserialize, Default)]
struct TermConfig {
verbose: Option<bool>,
quiet: Option<bool>,
color: Option<String>,
#[serde(default)]
#[serde(deserialize_with = "progress_or_string")]

View File

@ -241,7 +241,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -181,7 +181,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -185,7 +185,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -62,7 +62,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -156,7 +156,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -47,7 +47,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -258,7 +258,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -23,7 +23,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -62,7 +62,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -247,7 +247,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -32,7 +32,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -37,7 +37,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -335,7 +335,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -57,7 +57,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -64,7 +64,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -197,7 +197,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -53,7 +53,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -164,7 +164,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -101,7 +101,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -180,7 +180,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -172,7 +172,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -34,7 +34,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -255,7 +255,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -244,7 +244,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -46,7 +46,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -53,7 +53,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -79,7 +79,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -26,7 +26,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -59,7 +59,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -136,7 +136,9 @@ OPTIONS
value <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages.
Do not print cargo log messages. May also be specified with the
term.quiet config value
<https://doc.rust-lang.org/cargo/reference/config.html>.
--color when
Control when colored output is used. Valid values:

View File

@ -7,6 +7,8 @@ May also be specified with the `term.verbose`
{{#option "`-q`" "`--quiet`"}}
Do not print cargo log messages.
May also be specified with the `term.quiet`
[config value](../reference/config.html).
{{/option}}
{{#option "`--color` _when_"}}

View File

@ -299,7 +299,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-bench--q"><a class="option-anchor" href="#option-cargo-bench--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-bench---quiet"><a class="option-anchor" href="#option-cargo-bench---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-bench---color"><a class="option-anchor" href="#option-cargo-bench---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -236,7 +236,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-build--q"><a class="option-anchor" href="#option-cargo-build--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-build---quiet"><a class="option-anchor" href="#option-cargo-build---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-build---color"><a class="option-anchor" href="#option-cargo-build---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -236,7 +236,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-check--q"><a class="option-anchor" href="#option-cargo-check--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-check---quiet"><a class="option-anchor" href="#option-cargo-check---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-check---color"><a class="option-anchor" href="#option-cargo-check---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -84,7 +84,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-clean--q"><a class="option-anchor" href="#option-cargo-clean--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-clean---quiet"><a class="option-anchor" href="#option-cargo-clean---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-clean---color"><a class="option-anchor" href="#option-cargo-clean---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -210,7 +210,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-doc--q"><a class="option-anchor" href="#option-cargo-doc--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-doc---quiet"><a class="option-anchor" href="#option-cargo-doc---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-doc---color"><a class="option-anchor" href="#option-cargo-doc---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -57,7 +57,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-fetch--q"><a class="option-anchor" href="#option-cargo-fetch--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-fetch---quiet"><a class="option-anchor" href="#option-cargo-fetch---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-fetch---color"><a class="option-anchor" href="#option-cargo-fetch---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -316,7 +316,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-fix--q"><a class="option-anchor" href="#option-cargo-fix--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-fix---quiet"><a class="option-anchor" href="#option-cargo-fix---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-fix---color"><a class="option-anchor" href="#option-cargo-fix---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -32,7 +32,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-generate-lockfile--q"><a class="option-anchor" href="#option-cargo-generate-lockfile--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-generate-lockfile---quiet"><a class="option-anchor" href="#option-cargo-generate-lockfile---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-generate-lockfile---color"><a class="option-anchor" href="#option-cargo-generate-lockfile---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -80,7 +80,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-init--q"><a class="option-anchor" href="#option-cargo-init--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-init---quiet"><a class="option-anchor" href="#option-cargo-init---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-init---color"><a class="option-anchor" href="#option-cargo-init---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -292,7 +292,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-install--q"><a class="option-anchor" href="#option-cargo-install--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-install---quiet"><a class="option-anchor" href="#option-cargo-install---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-install---color"><a class="option-anchor" href="#option-cargo-install---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -46,7 +46,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-locate-project--q"><a class="option-anchor" href="#option-cargo-locate-project--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-locate-project---quiet"><a class="option-anchor" href="#option-cargo-locate-project---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-locate-project---color"><a class="option-anchor" href="#option-cargo-locate-project---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -48,7 +48,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-login--q"><a class="option-anchor" href="#option-cargo-login--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-login---quiet"><a class="option-anchor" href="#option-cargo-login---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-login---color"><a class="option-anchor" href="#option-cargo-login---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -360,7 +360,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-metadata--q"><a class="option-anchor" href="#option-cargo-metadata--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-metadata---quiet"><a class="option-anchor" href="#option-cargo-metadata---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-metadata---color"><a class="option-anchor" href="#option-cargo-metadata---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -75,7 +75,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-new--q"><a class="option-anchor" href="#option-cargo-new--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-new---quiet"><a class="option-anchor" href="#option-cargo-new---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-new---color"><a class="option-anchor" href="#option-cargo-new---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -86,7 +86,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-owner--q"><a class="option-anchor" href="#option-cargo-owner--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-owner---quiet"><a class="option-anchor" href="#option-cargo-owner---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-owner---color"><a class="option-anchor" href="#option-cargo-owner---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -243,7 +243,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-package--q"><a class="option-anchor" href="#option-cargo-package--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-package---quiet"><a class="option-anchor" href="#option-cargo-package---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-package---color"><a class="option-anchor" href="#option-cargo-package---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -59,7 +59,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-pkgid--q"><a class="option-anchor" href="#option-cargo-pkgid--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-pkgid---quiet"><a class="option-anchor" href="#option-cargo-pkgid---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-pkgid---color"><a class="option-anchor" href="#option-cargo-pkgid---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -209,7 +209,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-publish--q"><a class="option-anchor" href="#option-cargo-publish--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-publish---quiet"><a class="option-anchor" href="#option-cargo-publish---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-publish---color"><a class="option-anchor" href="#option-cargo-publish---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -146,7 +146,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-run--q"><a class="option-anchor" href="#option-cargo-run--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-run---quiet"><a class="option-anchor" href="#option-cargo-run---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-run---color"><a class="option-anchor" href="#option-cargo-run---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -225,7 +225,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-rustc--q"><a class="option-anchor" href="#option-cargo-rustc--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-rustc---quiet"><a class="option-anchor" href="#option-cargo-rustc---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-rustc---color"><a class="option-anchor" href="#option-cargo-rustc---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -229,7 +229,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-rustdoc--q"><a class="option-anchor" href="#option-cargo-rustdoc--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-rustdoc---quiet"><a class="option-anchor" href="#option-cargo-rustdoc---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-rustdoc---color"><a class="option-anchor" href="#option-cargo-rustdoc---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -52,7 +52,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-search--q"><a class="option-anchor" href="#option-cargo-search--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-search---quiet"><a class="option-anchor" href="#option-cargo-search---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-search---color"><a class="option-anchor" href="#option-cargo-search---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -315,7 +315,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-test--q"><a class="option-anchor" href="#option-cargo-test--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-test---quiet"><a class="option-anchor" href="#option-cargo-test---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-test---color"><a class="option-anchor" href="#option-cargo-test---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -280,7 +280,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-tree--q"><a class="option-anchor" href="#option-cargo-tree--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-tree---quiet"><a class="option-anchor" href="#option-cargo-tree---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-tree---color"><a class="option-anchor" href="#option-cargo-tree---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -61,7 +61,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-uninstall--q"><a class="option-anchor" href="#option-cargo-uninstall--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-uninstall---quiet"><a class="option-anchor" href="#option-cargo-uninstall---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-uninstall---color"><a class="option-anchor" href="#option-cargo-uninstall---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -70,7 +70,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-update--q"><a class="option-anchor" href="#option-cargo-update--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-update---quiet"><a class="option-anchor" href="#option-cargo-update---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-update---color"><a class="option-anchor" href="#option-cargo-update---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -102,7 +102,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-vendor--q"><a class="option-anchor" href="#option-cargo-vendor--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-vendor---quiet"><a class="option-anchor" href="#option-cargo-vendor---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-vendor---color"><a class="option-anchor" href="#option-cargo-vendor---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -35,7 +35,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-verify-project--q"><a class="option-anchor" href="#option-cargo-verify-project--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-verify-project---quiet"><a class="option-anchor" href="#option-cargo-verify-project---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-verify-project---color"><a class="option-anchor" href="#option-cargo-verify-project---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -79,7 +79,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo-yank--q"><a class="option-anchor" href="#option-cargo-yank--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo-yank---quiet"><a class="option-anchor" href="#option-cargo-yank---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo-yank---color"><a class="option-anchor" href="#option-cargo-yank---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -160,7 +160,9 @@ May also be specified with the <code>term.verbose</code>
<dt class="option-term" id="option-cargo--q"><a class="option-anchor" href="#option-cargo--q"></a><code>-q</code></dt>
<dt class="option-term" id="option-cargo---quiet"><a class="option-anchor" href="#option-cargo---quiet"></a><code>--quiet</code></dt>
<dd class="option-desc">Do not print cargo log messages.</dd>
<dd class="option-desc">Do not print cargo log messages.
May also be specified with the <code>term.quiet</code>
<a href="../reference/config.html">config value</a>.</dd>
<dt class="option-term" id="option-cargo---color"><a class="option-anchor" href="#option-cargo---color"></a><code>--color</code> <em>when</em></dt>

View File

@ -171,6 +171,7 @@ metadata_key1 = "value"
metadata_key2 = "value"
[term]
quiet = false # whether cargo output is quiet
verbose = false # whether cargo provides verbose output
color = 'auto' # whether cargo colorizes output
progress.when = 'auto' # whether cargo shows progress bar
@ -1009,6 +1010,16 @@ metadata_key2 = "value"
The `[term]` table controls terminal output and interaction.
##### `term.quiet`
* Type: boolean
* Default: false
* Environment: `CARGO_TERM_QUIET`
Controls whether or not log messages are displayed by Cargo.
Specifying the `--quiet` flag will override and force quiet output.
Specifying the `--verbose` flag will override and disable quiet output.
##### `term.verbose`
* Type: boolean
* Default: false

View File

@ -115,6 +115,7 @@ supported environment variables are:
* `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).
* `CARGO_TARGET_<triple>_RUNNER` — The executable runner, see [`target.<triple>.runner`].
* `CARGO_TARGET_<triple>_RUSTFLAGS` — Extra `rustc` flags for a target, see [`target.<triple>.rustflags`].
* `CARGO_TERM_QUIET` — Quiet mode, see [`term.quiet`].
* `CARGO_TERM_VERBOSE` — The default terminal verbosity, see [`term.verbose`].
* `CARGO_TERM_COLOR` — The default color mode, see [`term.color`].
* `CARGO_TERM_PROGRESS_WHEN` — The default progress bar showing mode, see [`term.progress.when`].
@ -177,6 +178,7 @@ supported environment variables are:
[`target.<triple>.linker`]: config.md#targettriplelinker
[`target.<triple>.runner`]: config.md#targettriplerunner
[`target.<triple>.rustflags`]: config.md#targettriplerustflags
[`term.quiet`]: config.md#termquiet
[`term.verbose`]: config.md#termverbose
[`term.color`]: config.md#termcolor
[`term.progress.when`]: config.md#termprogresswhen

View File

@ -301,6 +301,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -221,6 +221,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -222,6 +222,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -78,6 +78,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -189,6 +189,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -52,6 +52,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -317,6 +317,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -30,6 +30,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -79,6 +79,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -320,6 +320,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -45,6 +45,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -43,6 +43,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -353,6 +353,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -74,6 +74,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -85,6 +85,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -250,6 +250,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -85,6 +85,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -200,6 +200,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -122,6 +122,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -217,6 +217,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -208,6 +208,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -46,6 +46,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -317,6 +317,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -318,6 +318,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -69,6 +69,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -70,6 +70,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -97,6 +97,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -40,6 +40,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -74,6 +74,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -179,6 +179,8 @@ May also be specified with the \fBterm.verbose\fR
\fB\-\-quiet\fR
.RS 4
Do not print cargo log messages.
May also be specified with the \fBterm.quiet\fR
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR

View File

@ -39,12 +39,14 @@ fn cli_priority() {
jobs = 3
rustc = 'file'
[term]
quiet = false
verbose = false
",
);
let config = ConfigBuilder::new().build();
assert_eq!(config.get::<i32>("build.jobs").unwrap(), 3);
assert_eq!(config.get::<String>("build.rustc").unwrap(), "file");
assert_eq!(config.get::<bool>("term.quiet").unwrap(), false);
assert_eq!(config.get::<bool>("term.verbose").unwrap(), false);
let config = ConfigBuilder::new()
@ -58,6 +60,14 @@ fn cli_priority() {
assert_eq!(config.get::<i32>("build.jobs").unwrap(), 1);
assert_eq!(config.get::<String>("build.rustc").unwrap(), "cli");
assert_eq!(config.get::<bool>("term.verbose").unwrap(), true);
// Setting both term.verbose and term.quiet is invalid and is tested
// in the run test suite.
let config = ConfigBuilder::new()
.env("CARGO_TERM_QUIET", "false")
.config_arg("term.quiet=true")
.build();
assert_eq!(config.get::<bool>("term.quiet").unwrap(), true);
}
#[cargo_test]

View File

@ -22,18 +22,21 @@ fn simple() {
}
#[cargo_test]
fn simple_quiet() {
fn quiet_arg() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
p.cargo("run -q").with_stdout("hello").run();
p.cargo("run -q").with_stderr("").with_stdout("hello").run();
p.cargo("run --quiet").with_stdout("hello").run();
p.cargo("run --quiet")
.with_stderr("")
.with_stdout("hello")
.run();
}
#[cargo_test]
fn simple_quiet_and_verbose() {
fn quiet_arg_and_verbose_arg() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
@ -45,7 +48,7 @@ fn simple_quiet_and_verbose() {
}
#[cargo_test]
fn quiet_and_verbose_config() {
fn quiet_arg_and_verbose_config() {
let p = project()
.file(
".cargo/config",
@ -57,7 +60,52 @@ fn quiet_and_verbose_config() {
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
p.cargo("run -q").run();
p.cargo("run -q").with_stderr("").with_stdout("hello").run();
}
#[cargo_test]
fn verbose_arg_and_quiet_config() {
let p = project()
.file(
".cargo/config",
r#"
[term]
quiet = true
"#,
)
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
p.cargo("run -v")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
[RUNNING] `target/debug/foo[EXE]`",
)
.with_stdout("hello")
.run();
}
#[cargo_test]
fn quiet_config_and_verbose_config() {
let p = project()
.file(
".cargo/config",
r#"
[term]
verbose = true
quiet = true
"#,
)
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
p.cargo("run")
.with_status(101)
.with_stderr("[ERROR] cannot set both `term.verbose` and `term.quiet`")
.run();
}
#[cargo_test]