| 197 | |
| 198 | |
| 199 | void App::outputOptions(std::string const& stageName, std::ostream& strm) |
| 200 | { |
| 201 | // Force plugin loading. |
| 202 | StageFactory f(false); |
| 203 | |
| 204 | Stage* s = f.createStage(stageName); |
| 205 | if (!s) |
| 206 | { |
| 207 | std::cerr << "Unable to create stage " << stageName << "\n"; |
| 208 | return; |
| 209 | } |
| 210 | |
| 211 | ProgramArgs args; |
| 212 | s->addAllArgs(args); |
| 213 | |
| 214 | if (!m_showJSON) |
| 215 | { |
| 216 | strm << stageName << " -- " << PluginManager<Stage>::link(stageName) << |
| 217 | std::endl; |
| 218 | strm << headline << std::endl; |
| 219 | |
| 220 | args.dump2(strm , 2, 6, headline.size()); |
| 221 | } |
| 222 | else |
| 223 | { |
| 224 | std::ostringstream ostr; |
| 225 | args.dump3(ostr); |
| 226 | |
| 227 | NL::json array; |
| 228 | try |
| 229 | { |
| 230 | array = NL::json::parse(ostr.str()); |
| 231 | } |
| 232 | catch (NL::json::parse_error&) |
| 233 | {} |
| 234 | |
| 235 | NL::json object = { stageName, array }; |
| 236 | strm << object; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | |
| 241 | void App::outputOptions() |
nothing calls this directly
no test coverage detected