Skip to content

Commit

Permalink
More options (#21)
Browse files Browse the repository at this point in the history
* Build or bench without the `all` flag execute the command only on the current Cargo project

* Add release flags for the `build` command
  • Loading branch information
Kevin Lefèvre authored and kali committed May 29, 2017
1 parent 2b1f4f9 commit 4eb9f34
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/bin/cargo-dinghy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -196,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)
Expand Down Expand Up @@ -328,8 +337,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 {
Expand Down

0 comments on commit 4eb9f34

Please # to comment.