From c067bbca38d927140a82afa0223970ad0bc835c9 Mon Sep 17 00:00:00 2001 From: "killua.z" Date: Tue, 5 May 2026 11:58:50 +0400 Subject: [PATCH] update: example to display capturing capability via positional args. --- examples/test/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/test/main.cpp b/examples/test/main.cpp index 09561d1..1cbe83e 100644 --- a/examples/test/main.cpp +++ b/examples/test/main.cpp @@ -52,7 +52,7 @@ auto main() -> int { argument::start() .positional("count") - .position(0) + .position(1) .help_text("How many times to repeat the action.") .action([](int const& count) { std::cout << "count action configured for " << count << '\n'; @@ -66,6 +66,13 @@ auto main() -> int { .reference(captured_value) .build(parser); + argument::start() + .positional("captured") + .position(0) + .help_text("Store the parsed value through a reference.") + .reference(captured_value) + .build(parser); + // parser.add_argument({ // {ShortArgument, "c"}, // {HelpText, "capture count"},