From 6e570bca1680224e280c47101b2b2fbf00089a20 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 16 Mar 2020 19:23:35 -0700 Subject: [PATCH] modules/console: Sort SST files list by creation for output. --- modules/console.cc | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index f63a106fb..1bfeaf3dd 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -4102,22 +4102,22 @@ try if(colname == "*") { - auto fileinfos + db::database::sst::info::vector vector { - db::database::sst::info::vector(database) + database }; - std::sort(begin(fileinfos), end(fileinfos), [] + std::sort(begin(vector), end(vector), [] (const auto &a, const auto &b) { - return a.name < b.name; + return a.created < b.created; }); _print_sst_info_header(out); - for(const auto &fileinfo : fileinfos) + for(const auto &fileinfo : vector) _print_sst_info(out, fileinfo); - out << "-- " << fileinfos.size() << " files" + out << "-- " << vector.size() << " files" << std::endl; return true; @@ -4135,7 +4135,17 @@ try database, colname }; - const db::database::sst::info::vector vector{column}; + db::database::sst::info::vector vector + { + column + }; + + std::sort(begin(vector), end(vector), [] + (const auto &a, const auto &b) + { + return a.created < b.created; + }); + _print_sst_info_header(out); for(const auto &info : vector) _print_sst_info(out, info);