---------------------------------------------------------------------
| 114 | |
| 115 | //--------------------------------------------------------------------- |
| 116 | boost::optional<cov::StartInfo> |
| 117 | GetStartInfo(const ProgramOptionsVariablesMap& variablesMap) |
| 118 | { |
| 119 | const auto* programToRun = |
| 120 | variablesMap.GetOptionalValue<std::string>( |
| 121 | ProgramOptions::ProgramToRunOption); |
| 122 | |
| 123 | if (!programToRun) |
| 124 | return boost::none; |
| 125 | |
| 126 | cov::StartInfo startInfo{*programToRun}; |
| 127 | |
| 128 | const auto* arguments = |
| 129 | variablesMap.GetOptionalValue<std::vector<std::string>>( |
| 130 | ProgramOptions::ProgramToRunArgOption); |
| 131 | if (arguments) |
| 132 | { |
| 133 | for (const auto& arg : *arguments) |
| 134 | startInfo.AddArgument(Tools::LocalToWString(arg)); |
| 135 | } |
| 136 | |
| 137 | const auto* workingDirectory = |
| 138 | variablesMap.GetOptionalValue<std::string>( |
| 139 | ProgramOptions::WorkingDirectoryOption); |
| 140 | |
| 141 | if (workingDirectory) |
| 142 | startInfo.SetWorkingDirectory(*workingDirectory); |
| 143 | return startInfo; |
| 144 | } |
| 145 | |
| 146 | //------------------------------------------------------------------------- |
| 147 | void ParseConfigFile(const ProgramOptions& programOptions, |
no test coverage detected