Commit 242034da authored by Bart van der Velden's avatar Bart van der Velden

Fix build on Linux (#66)

parent 2ce5da65
......@@ -16,6 +16,7 @@
*****************************************************************************/
#include "HandleCommandLine.h"
#include <fstream>
#include <boost/program_options.hpp>
#include <boost/exception/all.hpp>
#include <boost/exception/get_error_info.hpp>
......@@ -113,8 +114,9 @@ bool HandleCommandLine(
}
catch (boost::program_options::invalid_syntax& e)
{
message = "Caught an invalid_syntax exception: ";
message += e.what();
stringstream ss;
ss << "Caught an invalid_syntax exception: " << e.what();
AddErrorMessage(message, ss.str());
retVal = false;
}
......@@ -123,7 +125,7 @@ bool HandleCommandLine(
// Help is the only action required.
stringstream ss;
ss << cmdLineOptions;
message = ss.str();
AddErrorMessage(message, ss.str());
retVal = false;
}
......@@ -136,15 +138,7 @@ bool HandleCommandLine(
ss << "MusicCollection, version: " << version.GetMajor() << "." <<
version.GetMinor() << ", git revision: " << version.GetGitSha1() << "\n";
ss << CopyrightNotice << "\n";
if (message.length() == 0)
{
message = ss.str();
}
else
{
message += "\n";
message += ss.str();
}
AddErrorMessage(message, ss.str());
retVal = false;
}
......@@ -155,7 +149,7 @@ bool HandleCommandLine(
stringstream ss;
ss << "Need to supply at least one directory\n";
ss << cmdLineOptions << "\n";
message == ss.str();
AddErrorMessage(message, ss.str());
retVal = false;
}
else
......@@ -166,7 +160,6 @@ bool HandleCommandLine(
{
//cout << "\t" << *it << "\n";
}
retVal = true;
}
if (vm.count("logfile") == 1)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment