0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

modules/console: Add ctx base cmd w/ fallback to ctx list.

This commit is contained in:
Jason Volk 2018-04-19 15:55:32 -07:00
parent 1dcfff91a5
commit f66acf6f8e

View file

@ -515,6 +515,42 @@ console_cmd__mod__unload(opt &out, const string_view &line)
return true;
}
//
// ctx
//
bool
console_cmd__ctx__list(opt &out, const string_view &line)
{
for(const auto *const &ctxp : ctx::ctxs)
{
const auto &ctx{*ctxp};
out << std::setw(5) << std::right << id(ctx);
out << " "
<< (started(ctx)? 'S' : '-')
<< (running(ctx)? 'R' : '-')
<< (waiting(ctx)? 'W' : '-')
<< (finished(ctx)? 'F' : '-')
<< (interruption(ctx)? 'I' : '-')
;
out << " " << std::setw(7) << std::right << stack_max(ctx) << " SS";
out << " :" << name(ctx);
out << std::endl;
}
return true;
}
bool
console_cmd__ctx(opt &out, const string_view &line)
{
if(empty(line))
return console_cmd__ctx__list(out, line);
return true;
}
//
// db
//