From 7b514deb80068c9e695cfdf4512461033348cab7 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 18 Apr 2018 14:27:18 -0700 Subject: [PATCH] modules/console: Add db base cmd w/ delegation to db list for empty arguments. --- modules/console.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index afac1fafd..a46735715 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -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 //