mirror of
https://github.com/matrix-construct/construct
synced 2024-12-23 22:13:55 +01:00
modules/console: Add rep prefix cmd.
This commit is contained in:
parent
dfb4e19848
commit
6f002f0b21
1 changed files with 27 additions and 0 deletions
|
@ -369,6 +369,33 @@ console_cmd__time(opt &out, const string_view &line)
|
|||
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
|
||||
|
||||
bool
|
||||
|
|
Loading…
Reference in a new issue