diff --git a/args.hxx b/args.hxx index dd12861..86a8672 100644 --- a/args.hxx +++ b/args.hxx @@ -990,7 +990,7 @@ namespace args #ifndef ARGS_NOEXCEPT if (max < min) { - throw UsageError("Nargs: max > min"); + throw UsageError("Nargs: max < min"); } #endif } diff --git a/test/nargs.cxx b/test/nargs.cxx index a22fb2a..20787e9 100644 --- a/test/nargs.cxx +++ b/test/nargs.cxx @@ -17,7 +17,7 @@ int main() args::NargsValueFlag d(parser, "", "", {'d'}, {1, 3}); args::Flag f(parser, "", "", {'f'}); - test::require_throws_as([&] { args::Nargs(3, 2); }); + test::require_throws_with([&] { args::Nargs(3, 2); }, "Nargs: max < min"); test::require_nothrow([&] { parser.ParseArgs(std::vector{"-a", "1", "2"}); }); test::require((*a == std::vector{1, 2}));