mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-21 15:51:43 +02:00
GH #48: Need getArgs() accessor
GH #48: Need getArgs() accessor to Util::Application to retrieve start-up arguments
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user