0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-28 17:52:54 +01:00

modules/console: Add key id argument w/ multiline diagnostic to key cmd.

This commit is contained in:
Jason Volk 2023-03-07 15:45:48 -08:00
parent 087d13d37e
commit 2ccc8b8be3

View file

@ -7049,7 +7049,7 @@ console_cmd__key(opt &out, const string_view &line)
{
const params param{line, " ",
{
"server_name"
"server_name", "key_id"
}};
const auto &server_name
@ -7057,6 +7057,22 @@ console_cmd__key(opt &out, const string_view &line)
param.at("server_name")
};
const auto &key_id
{
param["key_id"]
};
if(key_id)
{
m::keys::get(server_name, key_id, [&out]
(const m::keys &keys)
{
pretty(out, keys) << std::endl;
});
return true;
}
// keys cached for server by param.
m::keys::cache::for_each(server_name, [&out]
(const m::keys &keys)