From 918815a87450e42a6cd86d627d30739edf0369f2 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 5 Jul 2018 15:58:58 -0700 Subject: [PATCH] modules/console: Add db check cmd. --- modules/console.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index 70fa356b0..c75c86ad7 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -1840,6 +1840,32 @@ catch(const std::out_of_range &e) return true; } +bool +console_cmd__db__check(opt &out, const string_view &line) +try +{ + const auto dbname + { + token(line, ' ', 0) + }; + + auto &database + { + db::database::get(dbname) + }; + + check(database); + out << "Check of " << dbname << " completed without error." + << std::endl; + + return true; +} +catch(const std::out_of_range &e) +{ + out << "No open database by that name" << std::endl; + return true; +} + bool console_cmd__db__list(opt &out, const string_view &line) {