20 boost::program_options::options_description desc(
"This program opens and saves oks files to refresh their format");
22 std::vector<std::string> include;
23 std::vector<std::string> files;
24 bool show_hidden_attributes =
false;
29 (
"files,f", boost::program_options::value<std::vector<std::string> >(&files)->multitoken()->required(),
"oks files")
30 (
"include,i", boost::program_options::value<std::vector<std::string> >(&include)->multitoken(),
"preload oks files (to fix missing includes)")
31 (
"show-all-attributes,x",
"show hidden attributes with values equal to defaults")
32 (
"help,h",
"Print help message");
34 boost::program_options::variables_map vm;
35 boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
37 boost::program_options::notify(vm);
41 std::cout << desc << std::endl;
45 if (vm.count(
"show-all-attributes"))
46 show_hidden_attributes =
true;
48 catch (std::exception& ex)
50 std::cerr <<
"Command line parsing errors occurred:\n" << ex.what() << std::endl;
54 for (
const auto &x : files)
57 std::cout <<
"processing file " << x << std::endl;
58 OksKernel kernel(
false,
false,
false,
false);
60 for(
const auto& i : include)
65 if (f->get_oks_format() ==
"schema")
68 kernel.
save_data(f,
true,
nullptr, show_hidden_attributes);
72 oks::log_timestamp(oks::Error) <<
"Caught oks exception:\n" << ex << std::endl;