X-Git-Url: http://git.treefish.org/~alex/seamulator.git/blobdiff_plain/b23099025e3db2682b0260c0cef3a807fad136a8..6280f60567d99bd059818523fcdb0a710173b3d9:/src/seamulator.cpp?ds=sidebyside diff --git a/src/seamulator.cpp b/src/seamulator.cpp index 98e92df..ffbf586 100644 --- a/src/seamulator.cpp +++ b/src/seamulator.cpp @@ -29,28 +29,17 @@ struct Settings { double amplitudeFactor; }; -namespace po = boost::program_options; - void glDisplayFunc(); void glReshapeFunc(int width, int height); void glMouseFunc(int button, int state, int x, int y); void glMotionFunc(int x, int y); -Settings parseArguments(int argc, char** argv, po::options_description desc); +Settings parseArguments(int argc, char** argv); + +namespace po = boost::program_options; int main(int argc, char** argv) { - po::options_description desc("Available options"); - desc.add_options() - ("help,h", "produce help message") - ("windspeed,w", po::value()->default_value(10), - "wind speed given in m/s") - ("size,s", po::value()->default_value("small"), - "lattice size (small/large)") - ("amplitude,a", po::value()->default_value(1), - "amplitude multiplicator") - ; - - Settings settings = parseArguments(argc, argv, desc); + Settings settings = parseArguments(argc, argv); std::srand(std::time(0)); surface = std::make_shared(settings.latticeSize, @@ -79,8 +68,19 @@ int main(int argc, char** argv) return 0; } -Settings parseArguments(int argc, char** argv, po::options_description desc) +Settings parseArguments(int argc, char** argv) { + po::options_description desc("Available options"); + desc.add_options() + ("help,h", "show this help") + ("windspeed,w", po::value()->default_value(10), + "wind speed (m/s)") + ("size,s", po::value()->default_value('s'), + "lattice size (s|l)") + ("amplitude,a", po::value()->default_value(1), + "amplitude multiplicator") + ; + po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); po::notify(vm); @@ -94,7 +94,7 @@ Settings parseArguments(int argc, char** argv, po::options_description desc) settings.windSpeed = vm["windspeed"].as(); - if (vm["size"].as() == "large") { + if (vm["size"].as() == 'l') { settings.latticeSize = 256; settings.latticeExtend = 20; settings.amplitudeFactor = vm["amplitude"].as() * 0.00000004;