#include <Gaudi/Application.h>
#include <gsl/span>
#include <iostream>
#include <string_view>
Go to the source code of this file.
◆ GaudiMain()
| GAUDI_API int GaudiMain |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 21 of file GaudiMain.cpp.
24 std::string_view appType{
"Gaudi::Application"};
25 std::string_view optsFile;
30 return out <<
"usage: " <<
name <<
" [options] option_file\n";
33 auto arg =
args.begin();
35 while ( arg !=
args.end() ) {
36 std::string_view opt{*arg};
37 if ( opt ==
"--application" )
39 else if ( opt ==
"-h" || opt ==
"--help" ) {
43 -h, --help show this help message and exit 44 --application APPLICATION 45 name of the application class to use [default: Gaudi::Application] 48 }
else if ( opt[0] ==
'-' ) {
49 std::cerr <<
"error: unknown option " << opt <<
'\n';
58 if ( arg !=
args.end() ) {
std::cerr <<
"warning: ignoring extra positional arguments\n"; }
59 if ( optsFile.empty() ) {
60 std::cerr <<
"error: missing option file argument\n";
65 if ( optsFile.size() > 3 && optsFile.substr( optsFile.size() - 3 ) ==
".py" ) {
66 opts[
"ApplicationMgr.EvtSel"] =
"NONE";
67 opts[
"ApplicationMgr.JobOptionsType"] =
"NONE";
68 opts[
"ApplicationMgr.DLLs"] =
"['GaudiPython']";
69 opts[
"ApplicationMgr.Runable"] =
"PythonScriptingSvc";
71 opts[
"ApplicationMgr.JobOptionsPath"] = optsFile;
76 std::cerr <<
"error: failure creating " << appType <<
'\n';
void usage(std::string argv0)
def create(cls, appType, opts)
std::map< std::string, std::string > Options