From 5c9cda5257d63d518ac5bab4657b26f1b2734a35 Mon Sep 17 00:00:00 2001 From: jmestwa-coder Date: Tue, 26 May 2026 23:43:32 +0530 Subject: [PATCH] incorrect Nargs validation error message --- args.hxx | 2 +- test/nargs.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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}));