Add support for multiply calling lambda parsers in Clara

Previously a lambda parser in Clara could only be invoked once,
even if it internally was ok with being invoked multiple times.

With this change, a lambda parser can mark itself as `accept_many`,
in which case it will be invoked multiple times if the appropriate
flag was supplied multiple times by the user.
This commit is contained in:
Martin Hořeňovský
2021-10-27 18:57:56 +02:00
parent f17725a186
commit 12d14a3c63
11 changed files with 292 additions and 20 deletions

View File

@@ -102,6 +102,7 @@ Nor would this
:test-result: PASS Capture and info messages
:test-result: PASS Character pretty printing
:test-result: PASS Clara::Arg supports single-arg parse the way Opt does
:test-result: PASS Clara::Opt supports accept-many lambdas
:test-result: PASS Combining MatchAllOfGeneric does not nest
:test-result: PASS Combining MatchAnyOfGeneric does not nest
:test-result: PASS Combining MatchNotOfGeneric does not nest
@@ -297,6 +298,7 @@ Message from section two
:test-result: FAIL first tag
loose text artifact
:test-result: FAIL has printf
:test-result: PASS is_unary_function
:test-result: FAIL just failure
:test-result: FAIL just failure after unscoped info
:test-result: FAIL just info