mirror of
https://github.com/fanzeyi/cargo-play
synced 2024-11-25 11:50:19 +00:00
merge #22
This commit is contained in:
commit
040a52ae4f
2 changed files with 7 additions and 1 deletions
|
@ -55,6 +55,10 @@ pub struct Opt {
|
|||
/// Rebuild the cargo project without the cache from previous run
|
||||
pub clean: bool,
|
||||
|
||||
#[structopt(long = "test")]
|
||||
/// Build and run only tests in module
|
||||
pub test: bool,
|
||||
|
||||
#[structopt(short = "t", long = "toolchain", hidden = true)]
|
||||
pub toolchain: Option<String>,
|
||||
|
||||
|
|
|
@ -125,8 +125,10 @@ pub fn run_cargo_build(options: &Opt, project: &PathBuf) -> Result<ExitStatus, C
|
|||
cargo.arg(format!("+{}", toolchain));
|
||||
}
|
||||
|
||||
let subcommand = if options.test { "test" } else { "run" };
|
||||
|
||||
cargo
|
||||
.arg("run")
|
||||
.arg(subcommand)
|
||||
.arg("--manifest-path")
|
||||
.arg(project.join("Cargo.toml"));
|
||||
|
||||
|
|
Loading…
Reference in a new issue