Extend msg
and description
to work with any subcommand
Previously `description` only supported `Testing` and `Benchmarking`, and `msg` gave weird results for `doc` (it would say `Docing`).
This commit is contained in:
parent
20372f1817
commit
cb4b7f6319
3 changed files with 9 additions and 5 deletions
|
@ -644,12 +644,16 @@ impl Kind {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn test_description(&self) -> &'static str {
|
pub fn description(&self) -> String {
|
||||||
match self {
|
match self {
|
||||||
Kind::Test => "Testing",
|
Kind::Test => "Testing",
|
||||||
Kind::Bench => "Benchmarking",
|
Kind::Bench => "Benchmarking",
|
||||||
_ => panic!("not a test command: {}!", self.as_str()),
|
Kind::Doc => "Documenting",
|
||||||
|
Kind::Run => "Running",
|
||||||
|
Kind::Suggest => "Suggesting",
|
||||||
|
_ => return format!("{self:?}"),
|
||||||
}
|
}
|
||||||
|
.to_owned()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1020,8 +1020,8 @@ impl Build {
|
||||||
host: impl Into<Option<TargetSelection>>,
|
host: impl Into<Option<TargetSelection>>,
|
||||||
target: impl Into<Option<TargetSelection>>,
|
target: impl Into<Option<TargetSelection>>,
|
||||||
) -> Option<gha::Group> {
|
) -> Option<gha::Group> {
|
||||||
let action = action.into();
|
let action = action.into().description();
|
||||||
let msg = |fmt| format!("{action:?}ing stage{stage} {what}{fmt}");
|
let msg = |fmt| format!("{action} stage{stage} {what}{fmt}");
|
||||||
let msg = if let Some(target) = target.into() {
|
let msg = if let Some(target) = target.into() {
|
||||||
let host = host.into().unwrap();
|
let host = host.into().unwrap();
|
||||||
if host == target {
|
if host == target {
|
||||||
|
|
|
@ -101,7 +101,7 @@ impl Step for CrateBootstrap {
|
||||||
);
|
);
|
||||||
builder.info(&format!(
|
builder.info(&format!(
|
||||||
"{} {} stage0 ({})",
|
"{} {} stage0 ({})",
|
||||||
builder.kind.test_description(),
|
builder.kind.description(),
|
||||||
path,
|
path,
|
||||||
bootstrap_host,
|
bootstrap_host,
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue