From: Adam Dickmeiss Date: Sat, 29 Apr 2006 08:44:58 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: METAPROXY.1.0.3~25 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=453b8b497f712c5bac42ceaba0027d71706359b6;p=metaproxy-moved-to-github.git *** empty log message *** --- diff --git a/src/metaproxy_prog.cpp b/src/metaproxy_prog.cpp index 9151d0b..01f206b 100644 --- a/src/metaproxy_prog.cpp +++ b/src/metaproxy_prog.cpp @@ -1,4 +1,4 @@ -/* $Id: metaproxy_prog.cpp,v 1.1 2006-03-16 10:40:59 adam Exp $ +/* $Id: metaproxy_prog.cpp,v 1.2 2006-04-29 08:44:58 adam Exp $ Copyright (c) 2005-2006, Index Data. %LICENSE% @@ -25,7 +25,7 @@ int main(int argc, char **argv) { po::options_description desc("Allowed options"); desc.add_options() - ("help", "produce help message") + ("help,h", "produce help message") ("config", po::value< std::vector >(), "xml config") ; @@ -76,11 +76,23 @@ int main(int argc, char **argv) } catch (std::runtime_error &e) { std::cout << "std::runtime error: " << e.what() << "\n"; - exit(1); + std::exit(1); } xmlFreeDoc(doc); } } + catch (po::unknown_option &e) { + std::cerr << e.what() << "; use --help for list of options\n"; + std::exit(1); + } + catch (std::logic_error &e) { + std::cerr << "std::logic error: " << e.what() << "\n"; + std::exit(1); + } + catch (std::runtime_error &e) { + std::cout << "std::runtime error: " << e.what() << "\n"; + std::exit(1); + } catch ( ... ) { std::cerr << "Unknown Exception" << std::endl; std::exit(1);