diff options
author | Gordon Sim <gsim@apache.org> | 2007-05-25 11:24:54 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-05-25 11:24:54 +0000 |
commit | 45f0ee18e3dacf9e8c746009eaef4e17b0a44bf8 (patch) | |
tree | 67a2ae89ca92c9b4fdc94e2f6a817439e648d069 /cpp/src/qpid/CommonOptions.cpp | |
parent | f646350b5e59ccf49f1253bd55f98d062769f2ee (diff) | |
download | qpid-python-45f0ee18e3dacf9e8c746009eaef4e17b0a44bf8.tar.gz |
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
Diffstat (limited to 'cpp/src/qpid/CommonOptions.cpp')
-rw-r--r-- | cpp/src/qpid/CommonOptions.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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 <fstream> #include <algorithm> +#include <iostream> 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()); |