Changeset 612
- Timestamp:
- 07/24/08 11:52:14 (4 months ago)
- Files:
-
- trunk/rphp/frontend/cli/CMakeLists.txt (modified) (1 diff)
- trunk/rphp/frontend/cli/main.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/rphp/frontend/cli/CMakeLists.txt
r611 r612 9 9 10 10 add_executable( rphp ${CLI_SRC_FILES} ) 11 target_link_libraries( rphp rphp-eval rphp-runtime )11 target_link_libraries( rphp rphp-eval rphp-runtime boost_program_options ) 12 12 trunk/rphp/frontend/cli/main.cpp
r611 r612 1 1 2 2 #include <iostream> 3 #include <vector> 4 #include <string> 5 #include <boost/program_options.hpp> 3 6 #include "pDriver.h" 7 8 namespace po = boost::program_options; 4 9 5 10 int main( int argc, char* argv[] ) … … 7 12 8 13 rphp::pDriver driver; 14 15 //int opt; 16 po::options_description desc("Allowed options"); 17 desc.add_options() 18 ("help", "produce help message") 19 // ("optimization", po::value<int>(&opt)->default_value(10), "optimization level") 20 ("input-file", po::value< std::vector<std::string> >(), "input file") 21 ; 22 23 po::positional_options_description p; 24 p.add("input-file", -1); 25 26 po::variables_map vm; 27 po::store(po::command_line_parser(argc, argv). 28 options(desc).positional(p).run(), vm); 29 po::notify(vm); 30 31 if (vm.count("help") || !vm.count("input-file")) { 32 std::cout << desc << "\n"; 33 return 1; 34 } 9 35 10 36 std::cout << "Roadsend PHP" << std::endl; 11 driver.compile("fiddle.php");12 37 38 std::vector<std::string> infiles = vm["input-file"].as< std::vector<std::string> >(); 39 for (std::vector<std::string>::iterator it = infiles.begin(); it!=infiles.end(); ++it) { 40 driver.compile(*it); 41 } 42 43 //std::cout << "Optimization level is " << opt << "\n"; 44 13 45 }
