From 70f21e95cf594851076a4f2fe3afeb552ab19c90 Mon Sep 17 00:00:00 2001 From: Amine Aziz-Alaoui Date: Tue, 22 Sep 2020 15:42:05 +0200 Subject: [PATCH] add a parameter to make_help to inidicate output --- eo/src/utils/checkpointing | 2 +- eo/src/utils/make_help.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eo/src/utils/checkpointing b/eo/src/utils/checkpointing index ad190602a..60f2b81d4 100644 --- a/eo/src/utils/checkpointing +++ b/eo/src/utils/checkpointing @@ -50,7 +50,7 @@ #include "eoGenCounter.h" // and make_help - any better suggestion to include it? -void make_help(eoParser & _parser, bool exit_after = true); +void make_help(eoParser & _parser, bool exit_after = true, std::ostream& out = std::cout); #endif // !_CHECKPOINTING_ diff --git a/eo/src/utils/make_help.cpp b/eo/src/utils/make_help.cpp index b7d5ff766..b021e0177 100644 --- a/eo/src/utils/make_help.cpp +++ b/eo/src/utils/make_help.cpp @@ -44,7 +44,7 @@ * It is declared in all make_xxx.h files in representation-dependent dirs * but it is NOT representation-dependent itself - that's why it's in utils */ -void make_help(eoParser & _parser, bool exit_after) +void make_help(eoParser & _parser, bool exit_after, std::ostream& out) { // name of the "status" file where all actual parameter values will be saved std::string str_status = _parser.ProgramName() + ".status"; // default value @@ -62,8 +62,8 @@ void make_help(eoParser & _parser, bool exit_after) // i.e. in case you need parameters somewhere else, postpone these if (_parser.userNeedsHelp()) { - _parser.printHelp(std::cout); - std::cout << "You can use an edited copy of file " << statusParam.value() + _parser.printHelp(out); + out << "You can use an edited copy of file " << statusParam.value() << " as parameter file" << std::endl; if(exit_after) { exit(0);