aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/server
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-01-14 20:01:06 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-01-14 20:01:06 +0300
commit28ecc4417abcafe419a2a45c9263743a52248dea (patch)
tree22610d74f3356f9cc88363fbe8efb52a9727ce30 /server
parentfix .clang-format (diff)
downloadmath-server-28ecc4417abcafe419a2a45c9263743a52248dea.tar.gz
math-server-28ecc4417abcafe419a2a45c9263743a52248dea.zip
formatting fixes
Diffstat (limited to '')
-rw-r--r--server/main/settings.hpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/server/main/settings.hpp b/server/main/settings.hpp
index 11982da..4cff209 100644
--- a/server/main/settings.hpp
+++ b/server/main/settings.hpp
@@ -33,27 +33,28 @@ struct Settings {
class SettingsParser {
public:
explicit SettingsParser(const std::string& argv0) : m_prog_name{extract_filename(argv0)} {
+ namespace po = boost::program_options;
+
m_visible.add_options()("help,h", "show this message and exit");
- m_visible.add_options()("port,p",
- boost::program_options::value(&m_settings.m_port)
- ->default_value(Settings::DEFAULT_PORT),
- "server port number");
- m_visible.add_options()("threads,n",
- boost::program_options::value(&m_settings.m_threads)
- ->default_value(Settings::default_threads()),
- "number of threads");
+ m_visible.add_options()(
+ "port,p", po::value(&m_settings.m_port)->default_value(Settings::DEFAULT_PORT),
+ "server port number");
+ m_visible.add_options()(
+ "threads,n",
+ po::value(&m_settings.m_threads)->default_value(Settings::default_threads()),
+ "number of threads");
}
static const char* get_short_description() { return "[-h|--help] [-p|--port] [-n|--threads]"; }
Settings parse(int argc, char* argv[]) {
- boost::program_options::store(
- boost::program_options::command_line_parser{argc, argv}.options(m_visible).run(),
- m_settings.m_vm);
+ namespace po = boost::program_options;
+
+ po::store(po::command_line_parser{argc, argv}.options(m_visible).run(), m_settings.m_vm);
if (m_settings.exit_with_usage()) {
return m_settings;
}
- boost::program_options::notify(m_settings.m_vm);
+ po::notify(m_settings.m_vm);
return m_settings;
}