Changeset 10701
- Timestamp:
- 05/13/11 14:18:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/scheduler.cc
r10688 r10701 1 #include <vector> 2 1 3 #include <boost/bind.hpp> 2 4 #if BOOST_VERSION < 104400 … … 8 10 #include <boost/regex.hpp> 9 11 #include <boost/asio/deadline_timer.hpp> 10 12 #include <boost/date_time/posix_time/posix_time.hpp> 13 14 #include <mysql++/mysql++.h> 15 16 #include "FACT.h" 17 #include "Dim.h" 11 18 #include "Time.h" 12 19 #include "Event.h" … … 18 25 #include "Console.h" 19 26 #include "Converter.h" 27 #include "LocalControl.h" 20 28 21 29 #include "tools.h" 22 23 #include <vector>24 25 #include "LocalControl.h"26 #include <boost/date_time/posix_time/posix_time.hpp>27 #include <mysql++/mysql++.h>28 29 30 30 31 namespace ba = boost::asio; … … 750 751 } 751 752 753 void PrintUsage() 754 { 755 cout << 756 "The scheduler... TEXT MISSING\n" 757 "\n" 758 "The default is that the program is started without user intercation. " 759 "All actions are supposed to arrive as DimCommands. Using the -c " 760 "option, a local shell can be initialized. With h or help a short " 761 "help message about the usuage can be brought to the screen.\n" 762 "\n" 763 "Usage: scheduler [-c type] [OPTIONS]\n" 764 " or: scheduler [OPTIONS]\n"; 765 cout << endl; 766 } 767 768 void PrintHelp() 769 { 770 /* Additional help text which is printed after the configuration 771 options goes here */ 772 } 773 752 774 int main(int argc, const char* argv[]) 753 775 { 754 776 Configuration conf(argv[0]); 777 conf.SetPrintUsage(PrintUsage); 755 778 SetupConfiguration(conf); 756 779 … … 774 797 } 775 798 776 if (conf.Has("database")) 777 { 778 database = conf.Get<string>("database").c_str(); 779 } 780 else 799 if (conf.HasPrint()) 800 return -1; 801 802 if (conf.HasVersion()) 803 { 804 FACT::PrintVersion(argv[0]); 805 return -1; 806 } 807 808 if (conf.HasHelp()) 809 { 810 PrintHelp(); 811 return -1; 812 } 813 814 if (!conf.Has("database")) 781 815 { 782 816 cout << "Please provide which database you want to use for scheduling." << endl; … … 784 818 } 785 819 786 if (conf.HasHelp() || conf.HasPrint()) 787 return -1; 788 789 // To allow overwriting of DIM_DNS_NODE set 0 to 1 790 setenv("DIM_DNS_NODE", conf.Get<string>("dns").c_str(), 1); 791 792 try 820 database = conf.Get<string>("database").c_str(); 821 822 Dim::Setup(conf.Get<string>("dns")); 823 824 // try 793 825 { 794 826 // No console access at all … … 816 848 } 817 849 } 818 catch (std::exception& e)850 /* catch (std::exception& e) 819 851 { 820 852 std::cerr << "Exception: " << e.what() << "\n"; 821 } 853 }*/ 822 854 823 855 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.