26 #include <boost/program_options.hpp> 30 namespace po = boost::program_options;
32 int main (
int argc,
char** argv)
34 bool mergeRecordings =
false;
35 bool mergeModels =
false;
37 po::options_description desc(
"Allowed options");
39 (
"help,h",
"produce help message")
40 (
"target-file,t", po::value<string>()->default_value(
"record.sqlite"),
"target file")
43 po::options_description required(
"Required");
44 required.add_options()
45 (
"source-file,s", po::value<vector<string> >(),
"source file (precede each path by -s)")
48 po::options_description atLeastOne(
"At least one of these");
49 atLeastOne.add_options()
50 (
"merge-recording,r", po::bool_switch(&mergeRecordings),
"merge recordings")
51 (
"merge-models,m", po::bool_switch(&mergeModels),
"merge models")
58 po::store(po::parse_command_line(argc, argv, desc), vm);
61 if (vm.count(
"help") || !vm.count(
"target-file") || !vm.count(
"source-file") || (!mergeRecordings && !mergeModels))
68 vector<string> sourceFiles = vm[
"source-file"].as<vector<string> >();
69 string targetFile = vm[
"target-file"].as<
string>();
72 for (
string& source : sourceFiles)
84 cout<<
" into "<<targetFile<<endl;
85 cout<<
"Type yes to continue"<<endl;
88 transform(yes.begin(), yes.end(), yes.begin(), ::tolower);
91 cout<<
"aborting"<<endl;
97 data_merger.
merge(targetFile, sourceFiles,mergeRecordings, mergeModels);
void merge(const std::string &targetFile, const std::vector< std::string > &sourceFiles, bool mergeRecordings, bool mergeModels)
int main(int argc, char **argv)
this namespace contains all generally usable classes.