#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 11 of file GaudiMain.cpp.
14 std::string_view appType{
"Gaudi::Application"};
15 std::string_view optsFile;
20 return out <<
"usage: " <<
name <<
" [options] option_file\n";
23 auto arg =
args.begin();
25 while ( arg !=
args.end() ) {
26 std::string_view opt{*arg};
27 if ( opt ==
"--application" )
29 else if ( opt ==
"-h" || opt ==
"--help" ) {
33 -h, --help show this help message and exit 34 --application APPLICATION 35 name of the application class to use [default: Gaudi::Application] 38 }
else if ( opt[0] ==
'-' ) {
39 std::cerr <<
"error: unknown option " << opt <<
'\n';
48 if ( arg !=
args.end() ) {
std::cerr <<
"warning: ignoring extra positional arguments\n"; }
49 if ( optsFile.empty() ) {
50 std::cerr <<
"error: missing option file argument\n";
55 if ( optsFile.size() > 3 && optsFile.substr( optsFile.size() - 3 ) ==
".py" ) {
56 opts[
"ApplicationMgr.EvtSel"] =
"NONE";
57 opts[
"ApplicationMgr.JobOptionsType"] =
"NONE";
58 opts[
"ApplicationMgr.DLLs"] =
"['GaudiPython']";
59 opts[
"ApplicationMgr.Runable"] =
"PythonScriptingSvc";
61 opts[
"ApplicationMgr.JobOptionsPath"] = optsFile;
66 std::cerr <<
"error: failure creating " << appType <<
'\n';
void usage(std::string argv0)
def create(cls, appType, opts)
std::map< std::string, std::string > Options