Skip to content

Commit

Permalink
Allow specifying -v multiple times
Browse files Browse the repository at this point in the history
This commit modifies the CLI interface to allow the verbose (-v) flag to be
specified multiple times. This'll be used soon to have `-vv` indicate that more
output should be generated than `-v` during a normal build.

Currently this commit changes the behavior of whether warnings are printed to
print warnings for the **entire DAG of dependencies** if `-vv` is specified.
That is, `--cap-lints` is never passed nor is any warning from build scripts if
`-vv` is specified.
  • Loading branch information
alexcrichton committed Jun 14, 2016
1 parent a30f612 commit 805dfe4
Show file tree
Hide file tree
Showing 30 changed files with 129 additions and 60 deletions.
4 changes: 2 additions & 2 deletions src/bin/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Options {
flag_no_default_features: bool,
flag_target: Option<String>,
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_lib: bool,
Expand Down Expand Up @@ -42,7 +42,7 @@ Options:
--no-default-features Do not build the `default` feature
--target TRIPLE Build for the target triple
--manifest-path PATH Path to the manifest to build benchmarks for
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct Options {
flag_no_default_features: bool,
flag_target: Option<String>,
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_release: bool,
Expand Down Expand Up @@ -44,7 +44,7 @@ Options:
--no-default-features Do not build the `default` feature
--target TRIPLE Build for the target triple
--manifest-path PATH Path to the manifest to compile
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use cargo::util::process_builder::process;
pub struct Flags {
flag_list: bool,
flag_version: bool,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_explain: Option<String>,
Expand All @@ -41,7 +41,7 @@ Options:
-V, --version Print version info and exit
--list List installed commands
--explain CODE Run `rustc --explain CODE`
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct Options {
flag_package: Vec<String>,
flag_target: Option<String>,
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_release: bool,
Expand All @@ -27,7 +27,7 @@ Options:
--manifest-path PATH Path to the manifest to the package to clean
--target TRIPLE Target triple to clean output for (default all)
--release Whether or not to clean release artifacts
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct Options {
flag_no_deps: bool,
flag_open: bool,
flag_release: bool,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_package: Vec<String>,
Expand All @@ -39,7 +39,7 @@ Options:
--no-default-features Do not build the `default` feature
--target TRIPLE Build for the target triple
--manifest-path PATH Path to the manifest to document
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(RustcDecodable)]
pub struct Options {
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
}
Expand All @@ -19,7 +19,7 @@ Usage:
Options:
-h, --help Print this message
--manifest-path PATH Path to the manifest to fetch dependencies for
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/generate_lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(RustcDecodable)]
pub struct Options {
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
}
Expand All @@ -21,7 +21,7 @@ Usage:
Options:
-h, --help Print this message
--manifest-path PATH Path to the manifest to generate a lockfile for
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
";
Expand Down
4 changes: 2 additions & 2 deletions src/bin/git_checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cargo::util::{Config, CliResult, CliError, human, ToUrl};
pub struct Options {
flag_url: String,
flag_reference: String,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
}
Expand All @@ -20,7 +20,7 @@ Usage:
Options:
-h, --help Print this message
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
";
Expand Down
4 changes: 2 additions & 2 deletions src/bin/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo::util::{CliResult, Config};

#[derive(RustcDecodable)]
pub struct Options {
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_bin: bool,
Expand All @@ -28,7 +28,7 @@ Options:
control at all (none) overriding a global configuration.
--bin Use a binary instead of a library template
--name NAME Set the resulting package name
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
";
Expand Down
4 changes: 2 additions & 2 deletions src/bin/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Options {
flag_debug: bool,
flag_bin: Vec<String>,
flag_example: Vec<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_root: Option<String>,
Expand Down Expand Up @@ -53,7 +53,7 @@ Build and install options:
--bin NAME Only install the binary NAME
--example EXAMPLE Install the example EXAMPLE instead of binaries
--root DIR Directory to install packages into
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet Less output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use cargo::util::{CliResult, Config, human, ChainError};
pub struct Options {
flag_host: Option<String>,
arg_token: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
}
Expand All @@ -24,7 +24,7 @@ Usage:
Options:
-h, --help Print this message
--host HOST Host to set the token for
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct Options {
flag_no_default_features: bool,
flag_no_deps: bool,
flag_quiet: Option<bool>,
flag_verbose: Option<bool>,
flag_verbose: u32,
}

pub const USAGE: &'static str = "
Expand All @@ -35,7 +35,7 @@ Options:
--manifest-path PATH Path to the manifest
--format-version VERSION Format version [default: 1]
Valid values: 1
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
";
Expand Down
4 changes: 2 additions & 2 deletions src/bin/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo::util::{CliResult, Config};

#[derive(RustcDecodable)]
pub struct Options {
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_bin: bool,
Expand All @@ -28,7 +28,7 @@ Options:
control at all (none) overriding a global configuration.
--bin Use a binary instead of a library template
--name NAME Set the resulting package name
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
";
Expand Down
4 changes: 2 additions & 2 deletions src/bin/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct Options {
flag_add: Option<Vec<String>>,
flag_remove: Option<Vec<String>>,
flag_index: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_list: bool,
Expand All @@ -27,7 +27,7 @@ Options:
-l, --list List owners of a crate
--index INDEX Registry index to modify owners for
--token TOKEN API token to use when authenticating
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd;

#[derive(RustcDecodable)]
pub struct Options {
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_manifest_path: Option<String>,
Expand All @@ -27,7 +27,7 @@ Options:
--no-metadata Ignore warnings about a lack of human-usable metadata
--allow-dirty Allow dirty working directories to be packaged
--manifest-path PATH Path to the manifest to compile
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/pkgid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cargo::util::important_paths::{find_root_manifest_for_wd};

#[derive(RustcDecodable)]
pub struct Options {
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_manifest_path: Option<String>,
Expand All @@ -20,7 +20,7 @@ Usage:
Options:
-h, --help Print this message
--manifest-path PATH Path to the manifest to the package to clean
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct Options {
flag_host: Option<String>,
flag_token: Option<String>,
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_no_verify: bool,
Expand All @@ -27,7 +27,7 @@ Options:
--no-verify Don't verify package tarball before publish
--allow-dirty Allow publishing with a dirty source directory
--manifest-path PATH Path to the manifest of the package to publish
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Options {
flag_no_default_features: bool,
flag_target: Option<String>,
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_release: bool,
Expand All @@ -34,7 +34,7 @@ Options:
--no-default-features Do not build the `default` feature
--target TRIPLE Build for the target triple
--manifest-path PATH Path to the manifest to execute
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct Options {
flag_no_default_features: bool,
flag_target: Option<String>,
flag_manifest_path: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_release: bool,
Expand Down Expand Up @@ -47,7 +47,7 @@ Options:
--no-default-features Do not compile default features for the package
--target TRIPLE Target triple which compiles will be for
--manifest-path PATH Path to the manifest to fetch dependencies for
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Options {
flag_manifest_path: Option<String>,
flag_no_default_features: bool,
flag_open: bool,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_release: bool,
flag_quiet: Option<bool>,
flag_color: Option<String>,
Expand Down Expand Up @@ -44,7 +44,7 @@ Options:
--no-default-features Do not build the `default` feature
--target TRIPLE Build for the target triple
--manifest-path PATH Path to the manifest to document
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
Expand Down
4 changes: 2 additions & 2 deletions src/bin/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::cmp;
#[derive(RustcDecodable)]
pub struct Options {
flag_host: Option<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_limit: Option<u32>,
Expand All @@ -23,7 +23,7 @@ Usage:
Options:
-h, --help Print this message
--host HOST Host of a registry to search in
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
--limit LIMIT Limit the number of results (default: 10, max: 100)
Expand Down
4 changes: 2 additions & 2 deletions src/bin/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct Options {
flag_example: Vec<String>,
flag_test: Vec<String>,
flag_bench: Vec<String>,
flag_verbose: Option<bool>,
flag_verbose: u32,
flag_quiet: Option<bool>,
flag_color: Option<String>,
flag_release: bool,
Expand Down Expand Up @@ -47,7 +47,7 @@ Options:
--no-default-features Do not build the `default` feature
--target TRIPLE Build for the target triple
--manifest-path PATH Path to the manifest to build tests for
-v, --verbose Use verbose output
-v, --verbose ... Use verbose output
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
--no-fail-fast Run all tests regardless of failure
Expand Down
Loading

0 comments on commit 805dfe4

Please sign in to comment.