Changeset 11578
- Timestamp:
- 07/24/11 21:20:34 (13 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/fact.cc
r11576 r11578 51 51 SetupConfiguration(conf); 52 52 53 po::variables_map vm; 54 try 55 { 56 vm = conf.Parse(argc, argv); 57 } 58 #if BOOST_VERSION > 104000 59 catch (po::multiple_occurrences &e) 60 { 61 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 53 if (!conf.DoParse(argc, argv, PrintHelp)) 62 54 return -1; 63 }64 #endif65 catch (exception& e)66 {67 cerr << "Program options invalid due to: " << e.what() << endl;68 return -1;69 }70 71 if (conf.HasVersion() || conf.HasPrint())72 return -1;73 74 if (conf.HasHelp())75 {76 PrintHelp();77 return -1;78 }79 55 80 56 Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host")); -
trunk/FACT++/src/Configuration.cc
r11573 r11578 1233 1233 } 1234 1234 1235 bool 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 1235 1267 // -------------------------------------------------------------------------- 1236 1268 // -
trunk/FACT++/src/Configuration.h
r11483 r11578 125 125 // Process command line arguments 126 126 const po::variables_map &Parse(int argc, const char **argv); 127 bool DoParse(int argc, const char **argv, const std::function<void()> &func=std::function<void()>()); 127 128 128 129 bool HasVersion() -
trunk/FACT++/src/biasctrl.cc
r11577 r11578 622 622 SetupConfiguration(conf); 623 623 624 po::variables_map vm; 625 try 626 { 627 vm = conf.Parse(argc, argv); 628 } 629 #if BOOST_VERSION > 104000 630 catch (po::multiple_occurrences &e) 631 { 632 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 624 if (!conf.DoParse(argc, argv, PrintHelp)) 633 625 return -1; 634 }635 #endif636 catch (exception& e)637 {638 cerr << "Program options invalid due to: " << e.what() << endl;639 return -1;640 }641 642 if (conf.HasVersion() || conf.HasPrint())643 return -1;644 645 if (conf.HasHelp())646 {647 PrintHelp();648 return -1;649 }650 626 651 627 //try -
trunk/FACT++/src/chatclient.cc
r11574 r11578 79 79 SetupConfiguration(conf); 80 80 81 po::variables_map vm; 82 try 83 { 84 vm = conf.Parse(argc, argv); 85 } 86 #if BOOST_VERSION > 104000 87 catch (po::multiple_occurrences &e) 88 { 89 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 81 if (!conf.DoParse(argc, argv, PrintHelp)) 90 82 return -1; 91 }92 #endif93 catch (exception& e)94 {95 cerr << "Program options invalid due to: " << e.what() << endl;96 return -1;97 }98 99 if (conf.HasVersion() || conf.HasPrint())100 return -1;101 102 if (conf.HasHelp())103 {104 PrintHelp();105 return -1;106 }107 83 108 84 Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host")); -
trunk/FACT++/src/chatserv.cc
r11574 r11578 79 79 SetupConfiguration(conf); 80 80 81 po::variables_map vm; 82 try 83 { 84 vm = conf.Parse(argc, argv); 85 } 86 #if BOOST_VERSION > 104000 87 catch (po::multiple_occurrences &e) 88 { 89 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 81 if (!conf.DoParse(argc, argv, PrintHelp)) 90 82 return -1; 91 }92 #endif93 catch (exception& e)94 {95 cerr << "Program options invalid due to: " << e.what() << endl;96 return -1;97 }98 99 if (conf.HasVersion() || conf.HasPrint())100 return -1;101 102 if (conf.HasHelp())103 {104 PrintHelp();105 return -1;106 }107 83 108 84 Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host")); -
trunk/FACT++/src/datalogger.cc
r11577 r11578 2468 2468 SetupConfiguration(conf); 2469 2469 2470 po::variables_map vm; 2471 try 2472 { 2473 vm = conf.Parse(argc, argv); 2474 } 2475 #if BOOST_VERSION > 104000 2476 catch (po::multiple_occurrences &e) 2477 { 2478 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 2470 if (!conf.DoParse(argc, argv, PrintHelp)) 2479 2471 return -1; 2480 }2481 #endif2482 catch (exception& e)2483 {2484 cerr << "Program options invalid due to: " << e.what() << endl;2485 return -1;2486 }2487 2488 if (conf.HasVersion() || conf.HasPrint())2489 return -1;2490 2491 if (conf.HasHelp())2492 {2493 PrintHelp();2494 return -1;2495 }2496 2472 2497 2473 // try -
trunk/FACT++/src/dimctrl.cc
r11575 r11578 70 70 Main::SetupConfiguration(conf); 71 71 72 po::variables_map vm; 73 try 74 { 75 vm = conf.Parse(argc, argv); 76 } 77 #if BOOST_VERSION > 104000 78 catch (po::multiple_occurrences &e) 79 { 80 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 72 if (!conf.DoParse(argc, argv, PrintHelp)) 81 73 return -1; 82 }83 #endif84 catch (exception& e)85 {86 cerr << "Program options invalid due to: " << e.what() << endl;87 return -1;88 }89 90 if (conf.HasVersion() || conf.HasPrint())91 return -1;92 93 if (conf.HasHelp())94 {95 PrintHelp();96 return -1;97 }98 74 99 75 Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host")); -
trunk/FACT++/src/drivectrl.cc
r11577 r11578 999 999 SetupConfiguration(conf); 1000 1000 1001 po::variables_map vm; 1002 try 1003 { 1004 vm = conf.Parse(argc, argv); 1005 } 1006 #if BOOST_VERSION > 104000 1007 catch (po::multiple_occurrences &e) 1008 { 1009 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 1001 if (!conf.DoParse(argc, argv, PrintHelp)) 1010 1002 return -1; 1011 }1012 #endif1013 catch (exception& e)1014 {1015 cerr << "Program options invalid due to: " << e.what() << endl;1016 return -1;1017 }1018 1019 if (conf.HasVersion() || conf.HasPrint())1020 return -1;1021 1022 if (conf.HasHelp())1023 {1024 PrintHelp();1025 return -1;1026 }1027 1003 1028 1004 //try -
trunk/FACT++/src/fadctrl.cc
r11577 r11578 2069 2069 SetupConfiguration(conf); 2070 2070 2071 po::variables_map vm; 2072 try 2073 { 2074 vm = conf.Parse(argc, argv); 2075 } 2076 #if BOOST_VERSION > 104000 2077 catch (po::multiple_occurrences &e) 2078 { 2079 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 2071 if (!conf.DoParse(argc, argv, PrintHelp)) 2080 2072 return -1; 2081 }2082 #endif2083 catch (exception& e)2084 {2085 cerr << "Program options invalid due to: " << e.what() << endl;2086 return -1;2087 }2088 2089 if (conf.HasVersion() || conf.HasPrint())2090 return -1;2091 2092 if (conf.HasHelp())2093 {2094 PrintHelp();2095 return -1;2096 }2097 2073 2098 2074 // try -
trunk/FACT++/src/fitsdump.cc
r11566 r11578 682 682 SetupConfiguration(conf); 683 683 684 po::variables_map vm; 685 try 686 { 687 vm = conf.Parse(argc, argv); 688 } 689 #if BOOST_VERSION > 104000 690 catch (po::multiple_occurrences &e) 691 { 692 cerr << "Program options invalid due to: " << e.what() << " of option '" << e.get_option_name() << "'." << endl; 684 if (!conf.DoParse(argc, argv, PrintHelp)) 693 685 return -1; 694 }695 #endif696 catch (exception& e)697 {698 cerr << "Program options invalid due to: " << e.what() << endl;699 return -1;700 }701 702 if (conf.HasVersion() || conf.HasPrint())703 return -1;704 705 if (conf.HasHelp())706 {707 PrintHelp();708 return -1;709 }710 686 711 687 FitsDumper loader; -
trunk/FACT++/src/fitsloader.cc
r10884 r11578 676 676 SetupConfiguration(conf); 677 677 678 po::variables_map vm; 679 try 680 { 681 vm = conf.Parse(argc, argv); 682 } 683 #if BOOST_VERSION > 104000 684 catch (po::multiple_occurrences &e) 685 { 686 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 678 if (!conf.DoParse(argc, argv, PrintHelp)) 687 679 return -1; 688 }689 #endif690 catch (exception& e)691 {692 cerr << "Program options invalid due to: " << e.what() << endl;693 return -1;694 }695 696 if (conf.HasVersion() || conf.HasPrint())697 return -1;698 699 if (conf.HasHelp())700 {701 PrintHelp();702 return -1;703 }704 680 705 681 // if (!conf.Has("console")) -
trunk/FACT++/src/fscctrl.cc
r11577 r11578 588 588 SetupConfiguration(conf); 589 589 590 po::variables_map vm; 591 try 592 { 593 vm = conf.Parse(argc, argv); 594 } 595 #if BOOST_VERSION > 104000 596 catch (po::multiple_occurrences &e) 597 { 598 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 590 if (!conf.DoParse(argc, argv, PrintHelp)) 599 591 return -1; 600 }601 #endif602 catch (exception& e)603 {604 cerr << "Program options invalid due to: " << e.what() << endl;605 return -1;606 }607 608 if (conf.HasVersion() || conf.HasPrint())609 return -1;610 611 if (conf.HasHelp())612 {613 PrintHelp();614 return -1;615 }616 592 617 593 //try -
trunk/FACT++/src/ftmctrl.cc
r11577 r11578 2444 2444 SetupConfiguration(conf); 2445 2445 2446 po::variables_map vm; 2447 try 2448 { 2449 vm = conf.Parse(argc, argv); 2450 } 2451 #if BOOST_VERSION > 104000 2452 catch (po::multiple_occurrences &e) 2453 { 2454 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 2446 if (!conf.DoParse(argc, argv, PrintHelp)) 2455 2447 return -1; 2456 }2457 #endif2458 catch (exception& e)2459 {2460 cerr << "Program options invalid due to: " << e.what() << endl;2461 return -1;2462 }2463 2464 if (conf.HasVersion() || conf.HasPrint())2465 return -1;2466 2467 if (conf.HasHelp())2468 {2469 PrintHelp();2470 return -1;2471 }2472 2448 2473 2449 //try -
trunk/FACT++/src/mcp.cc
r11577 r11578 478 478 Main::SetupConfiguration(conf); 479 479 480 po::variables_map vm; 481 try 482 { 483 vm = conf.Parse(argc, argv); 484 } 485 #if BOOST_VERSION > 104000 486 catch (po::multiple_occurrences &e) 487 { 488 cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl; 480 if (!conf.DoParse(argc, argv, PrintHelp)) 489 481 return -1; 490 }491 #endif492 catch (exception& e)493 {494 cerr << "Program options invalid due to: " << e.what() << endl;495 return -1;496 }497 498 if (conf.HasVersion() || conf.HasPrint())499 return -1;500 501 if (conf.HasHelp())502 {503 PrintHelp();504 return -1;505 }506 482 507 483 //try -
trunk/FACT++/src/triggerschedule.cc
r11268 r11578 58 58 SetupConfiguration(conf); 59 59 60 po::variables_map vm; 61 try 62 { 63 vm = conf.Parse(argc, argv); 64 } 65 #if BOOST_VERSION > 104000 66 catch (po::multiple_occurrences &e) 67 { 68 cout << "Error: " << e.what() << " of '" << e.get_option_name() << "' option." << endl; 69 cout << endl; 60 if (!conf.DoParse(argc, argv, PrintHelp)) 70 61 return -1; 71 }72 #endif73 catch (std::exception &e)74 {75 cout << "Error: " << e.what() << endl;76 cout << endl;77 78 return -1;79 }80 81 if (conf.HasVersion() || conf.HasPrint())82 return -1;83 84 if (conf.HasHelp())85 {86 PrintHelp();87 return -1;88 }89 62 90 63 const string dbname = conf.Get<string>("schedule-database-name");
Note:
See TracChangeset
for help on using the changeset viewer.