mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/console: Add db base cmd w/ delegation to db list for empty arguments.
This commit is contained in:
parent
d64adf8916
commit
7b514deb80
1 changed files with 23 additions and 0 deletions
|
@ -1054,6 +1054,29 @@ console_cmd__db__list(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__db(opt &out, const string_view &line)
|
||||
try
|
||||
{
|
||||
if(empty(line))
|
||||
return console_cmd__db__list(out, line);
|
||||
|
||||
const params param{line, " ",
|
||||
{
|
||||
"dbname", "column"
|
||||
}};
|
||||
|
||||
auto &database
|
||||
{
|
||||
*db::database::dbs.at(param.at(0))
|
||||
};
|
||||
}
|
||||
catch(const std::out_of_range &e)
|
||||
{
|
||||
out << "No open database by that name" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// peer
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue