0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

modules/console: Add rep prefix cmd.

This commit is contained in:
Jason Volk 2023-01-26 18:30:21 -08:00
parent dfb4e19848
commit 6f002f0b21

View file

@ -369,6 +369,33 @@ console_cmd__time(opt &out, const string_view &line)
return ret; return ret;
} }
// Rep
bool
console_cmd__rep(opt &out, const string_view &line)
{
const params param{line, " ",
{
"count",
}};
const auto count
{
param.at<uint>("count")
};
const auto cmd
{
tokens_after(line, ' ', 0)
};
for(uint i(0); i < count; ++i)
if(!_console_command(out, cmd))
return false;
return true;
}
// Help // Help
bool bool