32main(
int argc,
char* argv[])
35 std::string oksfilename{
"" };
36 std::string outputfilename{
"" };
37 std::string object_uid{
"" };
38 std::string sessionname{
"" };
40 bpo::options_description options_description(
"Allowed options", 128);
42 options_description.add_options()
44 (
"help,h",
"Provide help message")
46 (
"file,f", bpo::value<std::string>(&oksfilename),
"OKS database file name")
49 bpo::value<std::string>(&object_uid)->default_value(
""),
50 "OKS object UID of root vertex; must be session, segment or application")(
52 bpo::value<std::string>(&sessionname)->default_value(
""),
53 "Name of the session associated with the root object (only needed if >1 session in the database)")(
55 bpo::value<std::string>(&outputfilename)->default_value(
"config.dot"),
56 "Output DOT file which can be used as input to GraphViz");
58 bpo::variables_map args;
60 auto display_help_message = [&options_description]() {
61 TLOG() <<
"create_config_plot : Generate dot graphs from database files" << std::endl
63 <<
"Usage: create_config_plot -f/--file <input OKS file> -r/--root-object <object UID for session, segment "
64 "or application> (-s/--session <session containing root-object>) (-o/--output <output DOT file, default "
68 << options_description << std::endl;
72 bpo::store(bpo::command_line_parser(argc, argv).options(options_description).
run(), args);
75 if (args.count(
"help") || !args.count(
"file")) {
76 display_help_message();
84 }
catch (
const bpo::error& e) {
86 display_help_message();
88 std::stringstream errmsgstr;
89 errmsgstr <<
"Incorrect command line argument: " << e.what();
92 }
catch (
const dunedaq::appmodel::BadConf& exc) {
93 std::stringstream errmsgstr;
94 errmsgstr <<
"Caught BadConf exception: " << exc;
97 }
catch (
const daqconf::GeneralGraphToolError& e) {