diff --git a/Util/include/Poco/Util/Application.h b/Util/include/Poco/Util/Application.h index 8c18cda4f..759828891 100644 --- a/Util/include/Poco/Util/Application.h +++ b/Util/include/Poco/Util/Application.h @@ -251,6 +251,9 @@ public: std::string commandName() const; /// Returns the command name used to invoke the application. + std::string commandPath() const; + /// Returns the full command path used to invoke the application. + LayeredConfiguration& config() const; /// Returns the application's configuration. diff --git a/Util/samples/SampleApp/src/SampleApp.cpp b/Util/samples/SampleApp/src/SampleApp.cpp index 99d542033..9af4d73ae 100644 --- a/Util/samples/SampleApp/src/SampleApp.cpp +++ b/Util/samples/SampleApp/src/SampleApp.cpp @@ -160,9 +160,8 @@ protected: if (!_helpRequested) { logger().information("Command line:"); - const ArgVec argVec = argv(); std::ostringstream ostr; - for (ArgVec::const_iterator it = argVec.begin(); it != argVec.end(); ++it) + for (ArgVec::const_iterator it = argv().begin(); it != argv().end(); ++it) { ostr << *it << ' '; } diff --git a/Util/src/Application.cpp b/Util/src/Application.cpp index 04b84cf0d..e25a2c16a 100644 --- a/Util/src/Application.cpp +++ b/Util/src/Application.cpp @@ -303,6 +303,12 @@ std::string Application::commandName() const } +std::string Application::commandPath() const +{ + return _pConfig->getString("application.path"); +} + + void Application::stopOptionsProcessing() { _stopOptionsProcessing = true;