20 std::string config_version, user_dir, branch_name;
25 boost::program_options::options_description desc(
"Clone and checkout oks repository.\n\n"
26 "By default the master branch is checkout. The \"branch\" command line option can be used to specify particular one. A branch will be created, if does not exist yet.\n"
27 "TDAQ_DB_VERSION process environment variable or \"version\" command line option can be used to specify particular version.\n"
28 "The output directory can be specified via command line, otherwise temporal directory will be created and its name will be reported.\n"
29 "If TDAQ_DB_USER_REPOSITORY process environment variable is set, the utility makes no effect.\n\n"
30 "The command line options are");
32 std::vector<std::string> app_types_list;
33 std::vector<std::string> segments_list;
36 (
"branch,b", boost::program_options::value<std::string>(&branch_name),
"checkout or create given branch name")
37 (
"version,e", boost::program_options::value<std::string>(&config_version),
"oks config version in type:value format, where type is \"hash\", \"date\" or \"tag\"")
38 (
"output-directory,o", boost::program_options::value<std::string>(&user_dir),
"output directory; if not defined, create temporal")
39 (
"verbose,v",
"print verbose information")
40 (
"help,h",
"print help message");
42 boost::program_options::variables_map vm;
43 boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
47 std::cout << desc << std::endl;
51 if (vm.count(
"verbose"))
54 boost::program_options::notify(vm);
56 catch (std::exception& ex)
58 std::cerr <<
"Command line parsing errors occurred:\n" << ex.what() << std::endl;
62 if (!getenv(
"TDAQ_DB_USER_REPOSITORY"))
65 setenv(
"TDAQ_DB_USER_REPOSITORY_PATH", user_dir.c_str(), 1);
67 OksKernel k(user_dir.empty() && !verbose, verbose,
false,
true, config_version.empty() ?
nullptr : config_version.c_str(), branch_name);