GH #48: Need getArgs() accessor

GH #48: Need getArgs() accessor to Util::Application to retrieve
start-up arguments
This commit is contained in:
aleks-f
2013-01-05 15:54:12 -06:00
parent 73a3a5e288
commit 7e8797fb5a
4 changed files with 45 additions and 18 deletions

View File

@@ -39,6 +39,7 @@
#include "Poco/Util/AbstractConfiguration.h"
#include "Poco/AutoPtr.h"
#include <iostream>
#include <sstream>
using Poco::Util::Application;
@@ -154,12 +155,20 @@ protected:
config().setString(name, value);
}
int main(const std::vector<std::string>& args)
int main(const ArgVec& args)
{
if (!_helpRequested)
{
logger().information("Command line:");
const ArgVec argVec = argv();
std::ostringstream ostr;
for (ArgVec::const_iterator it = argVec.begin(); it != argVec.end(); ++it)
{
ostr << *it << ' ';
}
logger().information(ostr.str());
logger().information("Arguments to main():");
for (std::vector<std::string>::const_iterator it = args.begin(); it != args.end(); ++it)
for (ArgVec::const_iterator it = args.begin(); it != args.end(); ++it)
{
logger().information(*it);
}