This to replace the code at src/core.c/Main.pm6#L258:
if $param.WHY and (@arg-help.grep:{ .key eq $argument}) == Empty {
my $why = $param.WHY.contents; # Use first defined
if $param.default -> $d {
my $def = $d();
given $def {
# Long number
# Long string
when Cool {
when Match { $_ = 'default Match object' }
when Rational { $_ .= Num; proceed }
when IO::Path { $_ .= absolute; proceed }
default {
$_ .= perl;
if .chars > 20 {
$_ .= substr(0, 16);
$_ ~= '…';
}
}
}
default {
$_ = "default { .^name } object"
}
}
$why ~= "[default: { $def }]";
}
@arg-help.push($argument => $why);
}
Any thoughts? If you'd rather this be a PR, I'll have to work more on it.