From 0907022bdf4e55e69c0ed084618e2e7730202dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Lefe=CC=80vre?= Date: Mon, 29 May 2017 15:17:46 +0200 Subject: [PATCH 1/2] Build or bench without the `all` flag execute the command only on the current Cargo project --- src/bin/cargo-dinghy.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bin/cargo-dinghy.rs b/src/bin/cargo-dinghy.rs index 5d742f41..77969b12 100644 --- a/src/bin/cargo-dinghy.rs +++ b/src/bin/cargo-dinghy.rs @@ -42,6 +42,9 @@ fn main() { .long("target") .takes_value(true) .help("target triple (rust conventions)")) + .arg(::clap::Arg::with_name("ALL") + .long("all") + .help("Test all packages in the workspace")) .arg(::clap::Arg::with_name("VERBOSE") .short("v") .long("verbose") @@ -175,6 +178,9 @@ fn main() { .long("target") .takes_value(true) .help("target triple (rust conventions)")) + .arg(::clap::Arg::with_name("ALL") + .long("all") + .help("Build all packages in the workspace")) .arg(::clap::Arg::with_name("VERBOSE") .short("v") .long("verbose") @@ -328,8 +334,10 @@ fn prepare_runnable(target: &str, matches.values_of("SPEC").map(|vs| vs.map(|s| s.to_string()).collect()).unwrap_or(vec![]); let spec = if !given_specs.is_empty() { cargo::ops::Packages::Packages(&given_specs) - } else { + } else if matches.is_present("ALL") { cargo::ops::Packages::All + } else { + cargo::ops::Packages::Packages(&[]) }; let options = cargo::ops::CompileOptions { From c5aa2f4a940a28d7c3dfdab88a40d6cc7e190266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Lefe=CC=80vre?= Date: Mon, 29 May 2017 15:18:05 +0200 Subject: [PATCH 2/2] Add release flags for the `build` command --- src/bin/cargo-dinghy.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/cargo-dinghy.rs b/src/bin/cargo-dinghy.rs index 77969b12..da8246e5 100644 --- a/src/bin/cargo-dinghy.rs +++ b/src/bin/cargo-dinghy.rs @@ -202,6 +202,9 @@ fn main() { .long("bench") .takes_value(true) .help("only the specified benchmark target")) + .arg(::clap::Arg::with_name("RELEASE") + .long("release") + .help("Build artifacts in release mode, with optimizations")) .arg(::clap::Arg::with_name("FEATURES") .long("features") .takes_value(true)