stderr_length_check::check();
},
("setup", Some(sub_command)) => match sub_command.subcommand() {
- ("intellij", Some(matches)) => setup::intellij::run(matches.value_of("rustc-repo-path")),
+ ("intellij", Some(matches)) => setup::intellij::setup_rustc_src(
+ matches
+ .value_of("rustc-repo-path")
+ .expect("this field is mandatory and therefore always valid"),
+ ),
("git-hook", Some(matches)) => setup::git_hook::install_hook(matches.is_present("force-override")),
+ ("vscode-tasks", Some(matches)) => setup::vscode::install_tasks(matches.is_present("force-override")),
_ => {},
},
- ("remove", Some(sub_command)) => {
- if let ("git-hook", Some(_)) = sub_command.subcommand() {
- setup::git_hook::remove_hook();
- }
+ ("remove", Some(sub_command)) => match sub_command.subcommand() {
+ ("git-hook", Some(_)) => setup::git_hook::remove_hook(),
+ ("intellij", Some(_)) => setup::intellij::remove_rustc_src(),
+ ("vscode-tasks", Some(_)) => setup::vscode::remove_tasks(),
+ _ => {},
},
("serve", Some(matches)) => {
let port = matches.value_of("port").unwrap().parse().unwrap();
.possible_values(&[
"style",
"correctness",
+ "suspicious",
"complexity",
"perf",
"pedantic",
.help("Forces the override of an existing git pre-commit hook")
.required(false),
),
+ )
+ .subcommand(
+ SubCommand::with_name("vscode-tasks")
+ .about("Add several tasks to vscode for formatting, validation and testing")
+ .arg(
+ Arg::with_name("force-override")
+ .long("force-override")
+ .short("f")
+ .help("Forces the override of existing vscode tasks")
+ .required(false),
+ ),
),
)
.subcommand(
SubCommand::with_name("remove")
.about("Support for undoing changes done by the setup command")
.setting(AppSettings::ArgRequiredElseHelp)
- .subcommand(SubCommand::with_name("git-hook").about("Remove any existing pre-commit git hook")),
+ .subcommand(SubCommand::with_name("git-hook").about("Remove any existing pre-commit git hook"))
+ .subcommand(SubCommand::with_name("vscode-tasks").about("Remove any existing vscode tasks"))
+ .subcommand(
+ SubCommand::with_name("intellij")
+ .about("Removes rustc source paths added via `cargo dev setup intellij`"),
+ ),
)
.subcommand(
SubCommand::with_name("serve")