0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

modules/console: Filter error peers by default unless argument.

This commit is contained in:
Jason Volk 2018-04-14 00:51:58 -07:00
parent f4015c597e
commit 428e209995

View file

@ -903,6 +903,11 @@ console_cmd__peer(opt &out, const string_view &line)
if(out.html) if(out.html)
return html__peer(out, line); return html__peer(out, line);
const bool all
{
has(line, "all")
};
for(const auto &p : server::peers) for(const auto &p : server::peers)
{ {
using std::setw; using std::setw;
@ -913,6 +918,9 @@ console_cmd__peer(opt &out, const string_view &line)
const auto &peer{*p.second}; const auto &peer{*p.second};
const net::ipport &ipp{peer.remote}; const net::ipport &ipp{peer.remote};
if(peer.err_has() && !all)
continue;
out << setw(40) << right << host; out << setw(40) << right << host;
if(ipp) if(ipp)