From 9c3ff7ede920804ee07c07bea4152745e55bf330 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 1 May 2007 20:17:25 +0000 Subject: Moved parseOptions from qipdd to CommonOptions where it can be re-used. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@534226 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpidd.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'qpid/cpp/src/qpidd.cpp') diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp index 38289ca333..978f9afe4f 100644 --- a/qpid/cpp/src/qpidd.cpp +++ b/qpid/cpp/src/qpidd.cpp @@ -77,26 +77,8 @@ struct QpiddOptions : public Broker::Options } void parse(int argc, char* argv[]) { - po::variables_map vm; - // Earlier sources get precedence. - po::store(po::parse_command_line(argc, argv, desc), vm); - try { - po::store(po::parse_environment(desc, po::env2option), vm); - } - catch (const logic_error& e) { - throw logic_error(string("parsing environment variables: ") - + e.what()); - } - po::notify(vm); // So we can use the value of config. - try { - ifstream conf(config.c_str()); - po::store(po::parse_config_file(conf, desc), vm); - } - catch (const logic_error& e) { - throw logic_error(string("parsing config file: ")+ e.what()); - } - po::notify(vm); - }; + parseOptions(desc, argc, argv, config); + } void usage(ostream& out) const { out << "Usage: qpidd [OPTIONS]" << endl << endl -- cgit v1.2.1