{
po::options_description generic("Generic options");
generic.add_options()
("help,h",
"produce this help message")
("package-name,p",
po::value<string>(),
"name of the package for which we create the configurables file")
("input-libraries,i",
po::value<string>(),
"libraries to extract the component configurables from")
("input-cfg,c",
po::value<string>(),
"path to the cfg file holding the description of the Configurable base "
"classes, the python module holding the Configurable definitions, etc...")
("output-dir,o",
po::value<string>()->default_value("../genConf"),
"output directory for genconf files.")
("debug-level,d",
po::value<int>()->default_value(0),
"debug level")
("load-library,l",
po::value< Strings_t >()->composing(),
"preloading library")
;
po::options_description
config(
"Configuration");
("configurable-module",
po::value<string>()->default_value("AthenaCommon"),
"Name of the module holding the configurable classes")
("configurable-default-name",
po::value<string>()->default_value("Configurable.DefaultName"),
"Default name for the configurable instance")
("configurable-algorithm",
po::value<string>()->default_value("ConfigurableAlgorithm"),
"Name of the configurable base class for Algorithm components")
("configurable-algtool",
po::value<string>()->default_value("ConfigurableAlgTool"),
"Name of the configurable base class for AlgTool components")
("configurable-auditor",
po::value<string>()->default_value("ConfigurableAuditor"),
"Name of the configurable base class for Auditor components")
("configurable-service",
po::value<string>()->default_value("ConfigurableService"),
"Name of the configurable base class for Service components")
;
po::options_description cmdline_options;
cmdline_options.add(
generic).add(
config);
po::options_description config_file_options;
config_file_options.add(
config);
po::options_description visible("Allowed options");
visible.add(
generic).add(
config);
po::variables_map vm;
try {
po::store( po::command_line_parser(
argc,
argv).
vm );
po::notify(vm);
if( vm.count("input-cfg") ) {
string cfgFileName = vm["input-cfg"].as<string>();
cfgFileName = fs::system_complete(
fs::path( cfgFileName ) ).string();
po::store( parse_config_file( ifs, config_file_options ), vm );
}
po::notify(vm);
}
catch ( po::error& err ) {
cout <<
"ERR0R: error detected while parsing command options: "<< err.what() <<
endl;
}
if( vm.count("help")) {
}
if( vm.count("package-name") ) {
pkgName = vm["package-name"].as<string>();
}
else {
cout <<
"ERROR: 'package-name' required" <<
endl;
}
if( vm.count("input-libraries") ) {
{
string tmp = vm["input-libraries"].as<string>();
boost::trim(tmp);
boost::split( inputLibs, tmp,
boost::is_any_of(" "),
boost::token_compress_on );
}
++iLib ) {
if ( 0 == lib.find("lib") ) {
lib = lib.substr(3);
}
if ( !lib.empty() &&
}
}
cout <<
"ERROR: input component library(ies) required !\n"
<< "ERROR: 'input-libraries' argument was ["
<< vm["input-libraries"].as<string>()
<< "]"
<< endl;
}
}
else {
cout <<
"ERROR: input component library(ies) required" <<
endl;
}
if( vm.count("output-dir") ) {
out = fs::system_complete(
fs::path( vm[
"output-dir"].as<string>() ) );
}
if ( vm.count("debug-level") ) {
PluginService::SetDebug( vm["debug-level"].as<int>() );
}
if ( vm.count("load-library") ) {
++lLib) {
SharedLibrary tmplib(*lLib) ;
tmplib.Load() ;
}
}
if ( !fs::exists( out ) ) {
try {
fs::create_directory(out);
}
catch ( fs::filesystem_error &err ) {
cout <<
"ERR0R: error creating directory: "<< err.what() <<
endl;
}
}
cout <<
":::::: libraries : [ ";
py.setConfigurableDefaultName(vm["configurable-default-name"].as<string>());
py.setConfigurableAlgorithm (vm["configurable-algorithm"].as<string>());
py.setConfigurableAlgTool (vm["configurable-algtool"].as<string>());
py.setConfigurableAuditor (vm["configurable-auditor"].as<string>());
py.setConfigurableService (vm["configurable-service"].as<string>());
try {
sc = py.genConfig( libs );
}
cout <<
"ERROR: Could not generate Configurable(s) !\n"
<<
"ERROR: Got exception: " << e.
what() << endl;
}
if ( EXIT_SUCCESS == sc ) {
initPy <<
"## Hook for " << pkgName <<
" genConf module\n" <<
flush;
}
cout <<
":::::: libraries : [ ";
cout <<
"] :::::: [DONE]" << endl;
}