From 59dd45544d60bfc55bcb9e4fcbea4b61f1835e04 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 7 Jun 2012 13:24:54 -0700 Subject: [PATCH] Catcg errors parsing command line options. --- src/main.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ce16372ced..7d2e6df332 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -112,12 +112,18 @@ int main(int argc, char* argv[]) else { // Parse options, if no error. - po::store(po::command_line_parser(argc, argv) - .options(desc) // Parse options. - .positional(p) // Remainder as --parameters. - .run(), - vm); - po::notify(vm); // Invoke option notify functions. + try { + po::store(po::command_line_parser(argc, argv) + .options(desc) // Parse options. + .positional(p) // Remainder as --parameters. + .run(), + vm); + po::notify(vm); // Invoke option notify functions. + } + catch (...) + { + iResult = 1; + } } if (iResult)