diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-11 23:36:53 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-13 02:00:38 +0300 |
commit | a57b38577786cb245937e96ff58c3f3881d9a1ec (patch) | |
tree | e73d6144269ef30605520464dd7f9eeeb7e02688 | |
parent | add Boost constraints to CMakeLists.txt (diff) | |
download | math-server-a57b38577786cb245937e96ff58c3f3881d9a1ec.tar.gz math-server-a57b38577786cb245937e96ff58c3f3881d9a1ec.zip |
more clang-format friendly boost::program_options usage
-rw-r--r-- | client/settings.hpp | 33 | ||||
-rw-r--r-- | server/main/settings.hpp | 18 |
2 files changed, 26 insertions, 25 deletions
diff --git a/client/settings.hpp b/client/settings.hpp index 25f230b..2e72dba 100644 --- a/client/settings.hpp +++ b/client/settings.hpp @@ -45,22 +45,23 @@ public: explicit SettingsParser(const std::string& argv0) : m_prog_name{extract_filename(argv0)} { - m_visible.add_options() - ("help,h", - "show this message and exit") - ("command,c", - boost::program_options::value(&m_settings.m_input), - "evaluate the argument expression and exit") - ("host,H", - boost::program_options::value(&m_settings.m_host)->default_value("localhost"), - "server host address") - ("port,p", - boost::program_options::value(&m_settings.m_port)->default_value(NetworkTransport::DEFAULT_PORT), - "server port number"); - m_hidden.add_options() - ("files", - boost::program_options::value<std::vector<std::string>>(&m_settings.m_files), - "shouldn't be visible"); + m_visible.add_options()("help,h", "show this message and exit"); + m_visible.add_options()( + "command,c", + boost::program_options::value(&m_settings.m_input), + "evaluate the argument expression and exit"); + m_visible.add_options()( + "host,H", + boost::program_options::value(&m_settings.m_host)->default_value("localhost"), + "server host address"); + m_visible.add_options()( + "port,p", + boost::program_options::value(&m_settings.m_port)->default_value(NetworkTransport::DEFAULT_PORT), + "server port number"); + m_hidden.add_options()( + "files", + boost::program_options::value<std::vector<std::string>>(&m_settings.m_files), + "shouldn't be visible"); m_positional.add("files", -1); } diff --git a/server/main/settings.hpp b/server/main/settings.hpp index 9f2e616..a334fe7 100644 --- a/server/main/settings.hpp +++ b/server/main/settings.hpp @@ -36,15 +36,15 @@ public: explicit SettingsParser(const std::string& argv0) : m_prog_name{extract_filename(argv0)} { - m_visible.add_options() - ("help,h", - "show this message and exit") - ("port,p", - boost::program_options::value(&m_settings.m_port)->default_value(Settings::DEFAULT_PORT), - "server port number") - ("threads,n", - boost::program_options::value(&m_settings.m_threads)->default_value(Settings::default_threads()), - "number of threads"); + 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"); } static const char* get_short_description() { |