Project
Loading...
Searching...
No Matches
CommandInfo.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14#include <sstream>
15#include <cassert>
16#include <cstring>
17
18namespace o2::framework
19{
20
21CommandInfo::CommandInfo(int argc, char* const* argv)
22{
23 assert(argc > 0);
24
25 std::stringstream commandStream;
26 commandStream << argv[0];
27
28 for (size_t ai = 1; ai < argc; ++ai) {
29 const char* arg = argv[ai];
30 if (strpbrk(arg, "\" ;@&") != nullptr || arg[0] == 0) {
31 commandStream << " '" << arg << "'";
32 } else if (strpbrk(arg, "'") != nullptr) {
33 commandStream << " \"" << arg << "\"";
34 } else {
35 commandStream << " " << arg;
36 }
37 }
38 command = commandStream.str();
39}
40
42{
43 if (!command.empty()) {
44 command += " | ";
45 }
46 command += other.command;
47}
48
49} // namespace o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
void merge(CommandInfo const &other)
VectorOfTObjectPtrs other