mirror of
https://github.com/fanzeyi/cargo-play
synced 2024-11-12 22:17:06 +00:00
add expand mode to use cargo-expand (#42)
This commit is contained in:
parent
67c5d5426e
commit
3518a8dde5
2 changed files with 8 additions and 1 deletions
|
@ -59,7 +59,7 @@ pub struct Options {
|
|||
short = "m",
|
||||
long = "mode",
|
||||
group = "modegroup",
|
||||
possible_values = &["test", "check"]
|
||||
possible_values = &["test", "check", "expand"]
|
||||
)]
|
||||
/// Specify run mode
|
||||
pub mode: Option<String>,
|
||||
|
@ -72,6 +72,11 @@ pub struct Options {
|
|||
#[structopt(long = "check", group = "modegroup")]
|
||||
pub check: bool,
|
||||
|
||||
/// Run code in expand mode (alias to `--mode expand`, requires
|
||||
/// `cargo-expand` is installed)
|
||||
#[structopt(long = "expand", group = "modegroup")]
|
||||
pub expand: bool,
|
||||
|
||||
#[structopt(short = "t", long = "toolchain", hidden = true)]
|
||||
pub toolchain: Option<String>,
|
||||
|
||||
|
|
|
@ -145,6 +145,8 @@ pub fn run_cargo_build(options: &Options, project: &PathBuf) -> Result<ExitStatu
|
|||
"test"
|
||||
} else if options.check {
|
||||
"check"
|
||||
} else if options.expand {
|
||||
"expand"
|
||||
} else if let Some(mode) = options.mode.as_ref() {
|
||||
mode.as_str()
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue