summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-01-18 20:10:44 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-01-18 20:27:37 (GMT)
commit0d3d7579032959203c5c52f5ced9de5494c7b0bf (patch)
tree1e166cbae3dac23e8f815bc32f856b6c0a666fbd /Swiften/Config
parentc2580661a20e30abaa23c61808d6370a575665c1 (diff)
downloadswift-0d3d7579032959203c5c52f5ced9de5494c7b0bf.zip
swift-0d3d7579032959203c5c52f5ced9de5494c7b0bf.tar.bz2
Cleaned up some code.
Diffstat (limited to 'Swiften/Config')
-rw-r--r--Swiften/Config/swiften-config.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/Swiften/Config/swiften-config.cpp b/Swiften/Config/swiften-config.cpp
index 832618d..4f4016e 100644
--- a/Swiften/Config/swiften-config.cpp
+++ b/Swiften/Config/swiften-config.cpp
@@ -40,14 +40,19 @@ int main(int argc, char* argv[]) {
boost::program_options::variables_map vm;
try {
boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
- } catch (boost::program_options::unknown_option option) {
+ boost::program_options::notify(vm);
+ }
+ catch (const boost::program_options::unknown_option& option) {
#if BOOST_VERSION >= 104200
- std::cout << "Ignoring unknown option " << option.get_option_name() << " but continuing." << std::endl;
+ std::cout << "Ignoring unknown option " << option.get_option_name() << std::endl;
#else
- std::cout << "Error: " << option.what() << " (continuing)" << std::endl;
+ std::cout << "Error: " << option.what() << std::endl;
#endif
}
- boost::program_options::notify(vm);
+ catch (const boost::program_options::error& e) {
+ std::cout << "Error: " << e.what() << std::endl;
+ return -1;
+ }
if (vm.count("help") > 0) {
std::cout << desc << "\n";