Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions src/bin/cargo-batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ fn main2(gctx: &mut GlobalContext) -> CliResult {
//println!("compile opts: {:#?}", compile_opts);
cmds.push(CommandState { ws, compile_opts });
}
"check" => {
let ws = args.workspace(gctx)?;
// This is a legacy behavior that causes `cargo check` to pass `--test`.
let test = matches!(
args.get_one::<String>("profile").map(String::as_str),
Some("test")
);
let mode = CompileMode::Check { test };
let compile_opts =
args.compile_options(gctx, mode, Some(&ws), ProfileChecking::LegacyTestOnly)?;

cmds.push(CommandState { ws, compile_opts });
}
"rustdoc" => {
let ws = args.workspace(gctx)?;
let output_format = if let Some(output_format) = args._value_of("output-format") {
Expand Down Expand Up @@ -325,6 +338,46 @@ pub fn build_cli() -> Command {
"Run `<cyan,bold>cargo help rustdoc</>` for more detailed information.\n"
)),
)
.subcommand(
subcommand("check")
// subcommand aliases are handled in aliased_command()
// .alias("c")
.about("Check a local package and all of its dependencies for errors")
.arg_future_incompat_report()
.arg_message_format()
.arg_silent_suggestion()
.arg_package_spec(
"Package(s) to check",
"Check all packages in the workspace",
"Exclude packages from the check",
)
.arg_targets_all(
"Check only this package's library",
"Check only the specified binary",
"Check all binaries",
"Check only the specified example",
"Check all examples",
"Check only the specified test target",
"Check all targets that have `test = true` set",
"Check only the specified bench target",
"Check all targets that have `bench = true` set",
"Check all targets",
)
.arg_features()
.arg_parallel()
.arg_release("Check artifacts in release mode, with optimizations")
.arg_profile("Check artifacts with the specified profile")
.arg_target_triple("Check for the target triple")
.arg_target_dir()
.arg_unit_graph()
.arg_timings()
.arg_manifest_path()
.arg_lockfile_path()
.arg_ignore_rust_version()
.after_help(color_print::cstr!(
"Run `<cyan,bold>cargo help check</>` for more detailed information.\n"
)),
)
}

fn setup_logger() {
Expand Down
Loading