xtask: exit after printing help

Causes the xtask build to print an error and exit if it doesn't
recognize the task argument. Just ran into this as a result of the
cramsoc -> bao1x rename in 1255bf1 -- the build wasn't recognizing
`baremetal-cramsoc` anymore but was proceeding with the compile anyway,
without setting the target or loader features.
This commit is contained in:
Nathan Perry 2025-09-24 21:22:00 -04:00
parent eb53319773
commit fee06f0a32
No known key found for this signature in database
GPG key ID: 2E4DE058CFDBB6F4

View file

@ -709,7 +709,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Some("generate-locales") => generate_locales()?,
Some("wycheproof-import") => wycheproof_import()?,
Some("dummy-template") => generate_app_menus(&Vec::new()),
_ => print_help(),
task => {
if let Some(task) = task {
eprintln!("error: task {task:?} not recognized");
}
print_help();
std::process::exit(1);
}
}
builder.build()?;