Skip to content

Commit 9ca9f4f

Browse files
committed
fix: improve multiple task error logging
Signed-off-by: Kaspar Schleiser <kaspar@schleiser.de>
1 parent c62176c commit 9ca9f4f

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

src/main.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,19 @@ fn cmd_build(
419419
let multiple = matches.get_flag("multiple");
420420

421421
if builds.len() > 1 && !multiple {
422-
debug!("laze: multiple task targets found:");
423-
for build_info in builds {
424-
debug!("{} {}", build_info.builder, build_info.binary);
425-
}
426-
427-
// TODO: allow running tasks for multiple targets
428-
return Err(anyhow!(
429-
"please specify one of these builders, or -m/--multiple-tasks."
422+
if log_enabled!(Debug) {
423+
debug!("laze: multiple task targets found:");
424+
for build_info in builds {
425+
debug!("{} {}", build_info.builder, build_info.binary);
426+
}
427+
return Err(anyhow!(
428+
"please specify only one builder, or add `-m`/`--multiple-tasks`."
429+
));
430+
} else {
431+
return Err(anyhow!(
432+
"multiple task targets found. Choose one (use `--verbose` to see options), or add `-m`/`--multiple-tasks`."
430433
));
434+
}
431435
}
432436

433437
let task_name = task;

0 commit comments

Comments
 (0)