#include <boost/program_options.hpp>
-
+
using namespace boost;
namespace po = boost::program_options;
("file,f",po::value< vector<string> >(),"Adds the file to the local database")
("dir,d",po::value< vector<string> >(),"Adds the directory to the local database")
("sync,s","Synchronizes the local database with the files")
- ("recurse,r","Recurse into sub-directories (default=off)");
+ ("recurse,r","Recurse into sub-directories (default=off)")
+ ("repair,R","Repair the database (on synchronization) (default=off)")
+ ("check,c","Check for attribute differences (on synchronization) (default=off)");
+
//Describes third group of options
po::options_description option("OPTIONS");
option.add_options()
("verbose,v",po::value<int>(&verb),"Verbosity level (default=`1')")
("debug,D",po::value<int>(&deb),"Debug messages level (default=`0')");
-
-
+
//Adds the groups into a big one
po::options_description cmdline_options;
cmdline_options.add(generic).add(command).add(option);
}
if (vm.count("dir")) {
std::vector<std::string> dirs=vm["dir"].as< vector<string> >();
- g.AddDir(handler,dirs.front(), vm.count("recurse"));
+ bool recu=false;
+ std::stringstream out;
+ out<<vm.count("recurse");
+ if(out.str().compare("1")==0){recu=true;}
+ g.AddDir(handler,dirs.front(), recu);
}
if (vm.count("sync")) {
- g.Synchronize(true,g.GetTreeHandler(handler));
+ bool rep=false;
+ bool chk=false;
+ std::stringstream out;
+ out<<vm.count("repair");
+ if(out.str().compare("1")==0){rep=true;}
+ std::stringstream out2;
+ out2<<vm.count("check");
+ if(out2.str().compare("1")==0){chk=true;}
+ g.Synchronize(rep,chk);
}
g.Finalize();
}
{
e.Print();
}
+
return 0;
}