-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinput.cpp
38 lines (31 loc) · 1.23 KB
/
input.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
///////////////////////////////////////////////////////////////////////////////
// Author: Steven Lamerton
// Copyright: 2013 Steven Lamerton
// License: MIT, see LICENSE
///////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <boost/program_options.hpp>
namespace po = boost::program_options;
bool parse_options(int argc, char** argv, po::variables_map &map)
{
po::options_description desc("Options");
desc.add_options()
("help,h", "Prints this help message")
("seed,s", po::value<int>()->default_value(0), "Sets RNG seed")
("size,n", po::value<int>()->default_value(1000), "Sets grid size")
("particles,p", po::value<int>()->default_value(50000),
"Sets particle count")
("threads,t", po::value<int>()->default_value(4),
"Sets thread count")
("output,o", po::value<std::string>()->default_value("output"),
"Output name");
po::store(po::parse_command_line(argc, argv, desc), map);
po::notify(map);
if(map.count("help"))
{
std::cout << desc << "\n";
return false;
}
return true;
}