From 45f0ee18e3dacf9e8c746009eaef4e17b0a44bf8 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 25 May 2007 11:24:54 +0000 Subject: Added support for recovering prepared transactions. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@541619 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/CommonOptions.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/CommonOptions.cpp') diff --git a/cpp/src/qpid/CommonOptions.cpp b/cpp/src/qpid/CommonOptions.cpp index 8ec1a42ee2..f272c71a27 100644 --- a/cpp/src/qpid/CommonOptions.cpp +++ b/cpp/src/qpid/CommonOptions.cpp @@ -19,6 +19,7 @@ #include "CommonOptions.h" #include #include +#include namespace qpid { namespace program_options { @@ -28,10 +29,9 @@ char env2optchar(char env) { } const std::string envPrefix("QPID_"); -const std::string ignore("QPID_DIR");//temporary hack - this env var is used in other ways; not an option std::string env2option(const std::string& env) { - if (env != ignore /*temp hack, see above*/ && env.find(envPrefix) == 0) { + if (env.find(envPrefix) == 0) { std::string opt = env.substr(envPrefix.size()); std::transform(opt.begin(), opt.end(), opt.begin(), env2optchar); return opt; @@ -62,6 +62,9 @@ void parseOptions( try { po::store(po::parse_environment(desc, po::env2option), vm); } + catch (const po::unknown_option& e) { + std::cerr << e.what() << std::endl; + } catch (const po::error& e) { throw po::error(std::string("parsing environment variables: ") + e.what()); -- cgit v1.2.1