CLI: untieStdIO() to avoid unwanted implicit flush() calls on std::cout → less write() calls
--- a/nbproject/configurations.xml Sun Dec 02 20:17:46 2018 +0100
+++ b/nbproject/configurations.xml Mon Dec 03 16:11:41 2018 +0100
@@ -103,6 +103,9 @@
<dependencyChecking>false</dependencyChecking>
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
+ <flagsDictionary>
+ <element flagsID="0" commonFlags="-O3"/>
+ </flagsDictionary>
<codeAssistance>
</codeAssistance>
<makefileType>
@@ -113,7 +116,10 @@
<executablePath>build/Release/src/welcome</executablePath>
<ccTool>
<incDir>
- <pElem>src</pElem>
+ <pElem>../relpipe-lib-reader.cpp/include</pElem>
+ <pElem>../relpipe-lib-writer.cpp/include</pElem>
+ <pElem>../relpipe-lib-cli.cpp/include</pElem>
+ <pElem>build/Release/src</pElem>
</incDir>
<preprocessorList>
<Elem>NDEBUG</Elem>
@@ -126,6 +132,10 @@
<preBuildFirst>true</preBuildFirst>
</preBuild>
</makefileType>
+ <item path="src/relpipe-tr-validator.cpp" ex="false" tool="1" flavor2="0">
+ <ccTool flags="0">
+ </ccTool>
+ </item>
</conf>
</confs>
</configurationDescriptor>
--- a/src/relpipe-tr-validator.cpp Sun Dec 02 20:17:46 2018 +0100
+++ b/src/relpipe-tr-validator.cpp Mon Dec 03 16:11:41 2018 +0100
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <cstdio>
#include <cstdlib>
#include <memory>
@@ -38,6 +39,8 @@
using namespace relpipe::tr::validator;
int main(int argc, char**argv) {
+ setlocale(LC_ALL, "");
+ CLI::untieStdIO();
CLI cli(argc, argv);
int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;