aboutsummaryrefslogtreecommitdiff
path: root/src/argument_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/argument_parser.cpp')
-rw-r--r--src/argument_parser.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/argument_parser.cpp b/src/argument_parser.cpp
index 16945f7..94c6a4a 100644
--- a/src/argument_parser.cpp
+++ b/src/argument_parser.cpp
@@ -9,7 +9,7 @@
namespace
{
-void optarg_error(char arg, const std::string_view &error)
+void optarg_error(char arg, const std::string_view &error) noexcept
{
std::cout << "Error: Invalid option argument for -" << arg << ". " << error
<< std::endl;
@@ -19,7 +19,7 @@ void optarg_error(char arg, const std::string_view &error)
/**
* Returns the current optarg as a string view.
*/
-std::string_view get_str_optarg()
+std::string_view get_str_optarg() noexcept
{
return std::string_view(optarg);
}
@@ -30,7 +30,7 @@ std::string_view get_str_optarg()
* @param arg The current command-line argument character
* @param check_zero Whether or not to make sure that the result is not zero
*/
-uint32_t get_uint_optarg(char arg, bool check_zero = false)
+uint32_t get_uint_optarg(char arg, bool check_zero = false) noexcept
{
auto conversion_result = str_to_uint(get_str_optarg());
@@ -44,16 +44,16 @@ uint32_t get_uint_optarg(char arg, bool check_zero = false)
} // namespace
ArgumentParser::ArgumentParser(
- IRandomNumberGeneratorFactory random_number_generator_factory)
+ IRandomNumberGeneratorFactory random_number_generator_factory) noexcept
: _random_number_generator_factory(random_number_generator_factory)
{
}
-ParsedArguments
-ArgumentParser::parse(const std::vector<option> &options,
- const std::string_view &short_options, const int &argc,
- char *const *argv) // NOLINT(cppcoreguidelines-avoid-c-arrays,
- // modernize-avoid-c-arrays)
+ParsedArguments ArgumentParser::parse(
+ const std::vector<option> &options, const std::string_view &short_options,
+ const int &argc,
+ char *const *argv) noexcept // NOLINT(cppcoreguidelines-avoid-c-arrays,
+ // modernize-avoid-c-arrays)
{
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
const auto args = std::vector<std::string_view>(argv, argv + argc);