#include "Sources.hpp" #include "Commands.hpp" #include "Cache.hpp" #include #include #include #include using namespace net::lliurex::apt; using namespace std; using namespace std::placeholders; class Application { public: /*! mandatory sources */ vector conf; /*! optional sources */ vector optional; Application(int argc,char * argv[]) { //this should be call before calling any other command command::Init(); if(argc<2) PrintUsage(); else { string arg(argv[1]); bool found = false; if(arg=="list") { conf = command::LoadConf(); command::List(conf); found=true; } if(arg=="show") { command::Show(); found=true; } if(arg=="check") { conf = command::LoadConf(); Sources src(Sources::SourcesList); vector status = command::Check(src,conf); for(command::Match m : status) { string txt=""; switch(m.status) { case FindLineStatus::Found: txt="complete"; break; case FindLineStatus::Partial: txt="partial"; break; } if(txt!="") { cout<name["C"]<<"]"< targets; for(int n=2;n targets; for(int n=2;n