12 #include <boost/program_options.hpp> 13 #include <boost/filesystem/path.hpp> 15 #include <fwAtomsPatch/VersionsManager.hpp> 33 int main(
int argc,
char** argv)
36 ::boost::program_options::options_description desc(
"Allowed options");
38 (
"help,h",
"produce help message")
39 (
"output,o", ::boost::program_options::value< std::string >(),
"set output file")
40 (
"context,f", ::boost::program_options::value< std::string >(),
"set context name")
41 (
"version,v", ::boost::program_options::value< std::string >(),
"set version name")
45 ::boost::program_options::variables_map vm;
46 ::boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
47 ::boost::program_options::notify(vm);
51 std::cout << desc <<
"\n";
54 else if(!vm.count(
"context"))
56 std::cout <<
"You must specify a context name." <<
"\n";
59 else if(!vm.count(
"version"))
61 std::cout <<
"You must specify a version name." <<
"\n";
64 else if(!vm.count(
"output"))
66 std::cout <<
"You must specify a output file." <<
"\n";
71 ::boost::filesystem::path versionFile(vm[
"output"].as< std::string >());
73 vm[
"version"].as< std::string >());
static FWATOMSPATCH_API void generateNewFile(const ::boost::filesystem::path &filePath, const std::string &context, const std::string &versionName)
Generates a .versions file with currently known data versions.