Ignore:
Timestamp:
07/24/11 21:20:34 (13 years ago)
Author:
tbretz
Message:
Moved some part of the initialization from main to Configure::DoParse
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Configuration.cc

    r11573 r11578  
    12331233}
    12341234
     1235bool Configuration::DoParse(int argc, const char **argv, const std::function<void()> &PrintHelp)
     1236{
     1237    try
     1238    {
     1239        Parse(argc, argv);
     1240    }
     1241#if BOOST_VERSION > 104000
     1242    catch (po::multiple_occurrences &e)
     1243    {
     1244        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
     1245        return false;
     1246    }
     1247#endif
     1248    catch (exception& e)
     1249    {
     1250        cerr << "Program options invalid due to: " << e.what() << endl;
     1251        return false;
     1252    }
     1253
     1254    if (HasVersion() || HasPrint())
     1255        return false;
     1256
     1257    if (HasHelp())
     1258    {
     1259        if (PrintHelp)
     1260            PrintHelp();
     1261        return false;
     1262    }
     1263
     1264    return true;
     1265}
     1266
    12351267// --------------------------------------------------------------------------
    12361268//
Note: See TracChangeset for help on using the changeset viewer.