Files
backup/src/commands/CommandList.cpp
2023-06-02 12:51:08 +02:00

17 lines
462 B
C++

//
// Created by Stepan Usatiuk on 23.05.2023.
//
#include "CommandList.h"
CommandList::CommandList() : Command("list") {
}
void CommandList::run(Context ctx) {
auto list = ctx.repo->getObjects(Object::ObjectType::Archive);
std::sort(list.begin(), list.end(), [](const auto &l, const auto &r) { return l.second < r.second; });
for (auto const &aid: list) {
std::cout << "Name: " << aid.first << " Id: " << aid.second << std::endl;
}
}