From: Aleksey Kladov Date: Wed, 7 Mar 2018 10:02:35 +0000 (+0300) Subject: Specify frozen & locked for all commands simultaneously X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~47^2~59 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8518be6cf82e26e3d3656edd3c0fcfd5f8a61f99;p=cargo.git Specify frozen & locked for all commands simultaneously --- diff --git a/src/bin/cli/bench.rs b/src/bin/cli/bench.rs index fa0432032..5a84ff317 100644 --- a/src/bin/cli/bench.rs +++ b/src/bin/cli/bench.rs @@ -45,7 +45,6 @@ pub fn cli() -> App { .arg( opt("no-fail-fast", "Run all benchmarks regardless of failure") ) - .arg_locked() .after_help("\ All of the trailing arguments are passed to the benchmark binaries generated for filtering benchmarks and generally providing options configuring how they diff --git a/src/bin/cli/build.rs b/src/bin/cli/build.rs index 9316ca7a9..9587cb08d 100644 --- a/src/bin/cli/build.rs +++ b/src/bin/cli/build.rs @@ -26,7 +26,6 @@ pub fn cli() -> App { .arg_target_triple("Build for the target triple") .arg_manifest_path() .arg_message_format() - .arg_locked() .after_help("\ If the --package argument is given, then SPEC is a package id specification which indicates which package should be built. If it is not given, then the diff --git a/src/bin/cli/check.rs b/src/bin/cli/check.rs index c482fb55c..b77d7153d 100644 --- a/src/bin/cli/check.rs +++ b/src/bin/cli/check.rs @@ -30,7 +30,6 @@ pub fn cli() -> App { .arg_target_triple("Check for the target triple") .arg_manifest_path() .arg_message_format() - .arg_locked() .after_help("\ If the --package argument is given, then SPEC is a package id specification which indicates which package should be built. If it is not given, then the diff --git a/src/bin/cli/clean.rs b/src/bin/cli/clean.rs index db494419e..eafdb98b6 100644 --- a/src/bin/cli/clean.rs +++ b/src/bin/cli/clean.rs @@ -10,7 +10,6 @@ pub fn cli() -> App { .arg_manifest_path() .arg_target_triple("Target triple to clean output for (default all)") .arg_release("Whether or not to clean release artifacts") - .arg_locked() .after_help("\ If the --package argument is given, then SPEC is a package id specification which indicates which package's artifacts should be cleaned out. If it is not diff --git a/src/bin/cli/doc.rs b/src/bin/cli/doc.rs index 7e158c2ed..9a567464d 100644 --- a/src/bin/cli/doc.rs +++ b/src/bin/cli/doc.rs @@ -25,7 +25,6 @@ pub fn cli() -> App { .arg_target_triple("Build for the target triple") .arg_manifest_path() .arg_message_format() - .arg_locked() .after_help("\ By default the documentation for the local package and all dependencies is built. The output is all placed in `target/doc` in rustdoc's usual format. diff --git a/src/bin/cli/fetch.rs b/src/bin/cli/fetch.rs index 1a7a0b551..611a2eb37 100644 --- a/src/bin/cli/fetch.rs +++ b/src/bin/cli/fetch.rs @@ -4,7 +4,6 @@ pub fn cli() -> App { subcommand("fetch") .about("Fetch dependencies of a package from the network") .arg_manifest_path() - .arg_locked() .after_help("\ If a lockfile is available, this command will ensure that all of the git dependencies and/or registries dependencies are downloaded and locally diff --git a/src/bin/cli/generate_lockfile.rs b/src/bin/cli/generate_lockfile.rs index faf0c35e7..438c43f2e 100644 --- a/src/bin/cli/generate_lockfile.rs +++ b/src/bin/cli/generate_lockfile.rs @@ -4,7 +4,6 @@ pub fn cli() -> App { subcommand("generate-lockfile") .about("Generate the lockfile for a project") .arg_manifest_path() - .arg_locked() .after_help("\ If a lockfile is available, this command will ensure that all of the git dependencies and/or registries dependencies are downloaded and locally diff --git a/src/bin/cli/git_checkout.rs b/src/bin/cli/git_checkout.rs index b926db969..68250b971 100644 --- a/src/bin/cli/git_checkout.rs +++ b/src/bin/cli/git_checkout.rs @@ -5,5 +5,4 @@ pub fn cli() -> App { .about("Checkout a copy of a Git repository") .arg(Arg::with_name("url").long("url").value_name("URL").required(true)) .arg(Arg::with_name("reference").long("reference").value_name("REF").required(true)) - .arg_locked() } diff --git a/src/bin/cli/init.rs b/src/bin/cli/init.rs index 74744c461..c0f3182b8 100644 --- a/src/bin/cli/init.rs +++ b/src/bin/cli/init.rs @@ -24,5 +24,4 @@ a global configuration." opt("name", "Set the resulting package name") .value_name("NAME") ) - .arg_locked() } diff --git a/src/bin/cli/mod.rs b/src/bin/cli/mod.rs index 2f2a46624..00bdacb90 100644 --- a/src/bin/cli/mod.rs +++ b/src/bin/cli/mod.rs @@ -107,9 +107,9 @@ pub fn do_main(config: &mut Config) -> Result<(), CliError> { Ok(opts) } + config_from_args(config, &args)?; match args.subcommand() { ("bench", Some(args)) => { - config_from_args(config, args)?; let ws = workspace_from_args(config, args)?; let compile_opts = compile_options_from_args(config, args, CompileMode::Bench)?; @@ -136,14 +136,12 @@ pub fn do_main(config: &mut Config) -> Result<(), CliError> { }; } ("build", Some(args)) => { - config_from_args(config, args)?; let ws = workspace_from_args(config, args)?; let compile_opts = compile_options_from_args(config, args, CompileMode::Build)?; ops::compile(&ws, &compile_opts)?; return Ok(()); } ("check", Some(args)) => { - config_from_args(config, args)?; let ws = workspace_from_args(config, args)?; let test = match args.value_of("profile") { Some("test") => true, @@ -160,7 +158,6 @@ pub fn do_main(config: &mut Config) -> Result<(), CliError> { return Ok(()); } ("clean", Some(args)) => { - config_from_args(config, args)?; let ws = workspace_from_args(config, args)?; let opts = ops::CleanOptions { config, @@ -172,7 +169,6 @@ pub fn do_main(config: &mut Config) -> Result<(), CliError> { return Ok(()); } ("doc", Some(args)) => { - config_from_args(config, args)?; let ws = workspace_from_args(config, args)?; let mode = ops::CompileMode::Doc { deps: !args.is_present("no-deps") }; let compile_opts = compile_options_from_args(config, args, mode)?; @@ -184,20 +180,16 @@ pub fn do_main(config: &mut Config) -> Result<(), CliError> { return Ok(()); } ("fetch", Some(args)) => { - config_from_args(config, args)?; let ws = workspace_from_args(config, args)?; ops::fetch(&ws)?; return Ok(()); } ("generate-lockfile", Some(args)) => { - config_from_args(config, args)?; let ws = workspace_from_args(config, args)?; ops::generate_lockfile(&ws)?; return Ok(()); } ("git-checkout", Some(args)) => { - config_from_args(config, args)?; - let url = args.value_of("url").unwrap().to_url()?; let reference = args.value_of("reference").unwrap(); @@ -211,8 +203,6 @@ pub fn do_main(config: &mut Config) -> Result<(), CliError> { return Ok(()); } ("init", Some(args)) => { - config_from_args(config, args)?; - let path = args.value_of("path").unwrap_or("."); let vcs = args.value_of("vcs").map(|vcs| match vcs { "git" => VersionControl::Git, @@ -270,6 +260,14 @@ fn cli() -> App { opt("color", "Coloring: auto, always, never") .value_name("WHEN").global(true) ) + .arg( + opt("frozen", "Require Cargo.lock and cache are up to date") + .global(true) + ) + .arg( + opt("locked", "Require Cargo.lock is up to date") + .global(true) + ) .arg( Arg::with_name("unstable-features").help("Unstable (nightly-only) flags to Cargo") .short("Z").value_name("FLAG").multiple(true).global(true)