From aaa5ccada8372694a92f2abdeae0009999143cce Mon Sep 17 00:00:00 2001 From: dehnert Date: Tue, 27 Nov 2012 19:54:40 +0100 Subject: [PATCH] Added command line arguments to MRMC to log output. --- src/mrmc.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mrmc.cpp b/src/mrmc.cpp index 269e01d9a..5402cab10 100644 --- a/src/mrmc.cpp +++ b/src/mrmc.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "mrmc-config.h" #include "src/models/Dtmc.h" @@ -55,7 +56,14 @@ int main(const int argc, const char* argv[]) { mrmc::settings::Settings* s = NULL; - LOG4CPLUS_INFO(logger, "This is the Markov Reward Model Checker (MRMC) by i2 of RWTH Aachen university."); + LOG4CPLUS_INFO(logger, "This is the Markov Reward Model Checker (MRMC) by i2 of RWTH Aachen University."); + + // "Compute" the command line argument string with which MRMC was invoked and log as diagnostic information. + std::stringstream commandStream; + for (int i = 0; i < argc; ++i) { + commandStream << argv[i] << " "; + } + LOG4CPLUS_INFO(logger, "MRMC command invoked " << commandStream.str()); try { s = mrmc::settings::Settings::instance(argc, argv, nullptr); @@ -66,13 +74,11 @@ int main(const int argc, const char* argv[]) { return 1; } - if (s->isSet("help")) - { + if (s->isSet("help")) { std::cout << mrmc::settings::help << std::endl; return 0; } - if (s->isSet("help-config")) - { + if (s->isSet("help-config")) { std::cout << mrmc::settings::helpConfigfile << std::endl; return 0; }