Skip to content

Commit 4b81d69

Browse files
committed
YT-CPPAP-61: Add subparsers support
- Extended the `argument_parser` class with members and functions allowing users to manage subparsers - Aligned the argument parsing functionality: - A parser tries to match the first argument from its input argument range to a subparser - If a match is found, the corresponding subparser is invoked with the remaining arguments - If no match is found, the current parser finalizes parsing arguments - Aligned the argument parsing functionality to allow forward ranges only - Added the `name` and `program_name` attribute accessor functions in `argument_parser` - Restricted the creation of positional arguments to using only one argument name - Added the possibility to bind positional arguments to argument groups - Added an `is_used(arg_name)` method for checking the usage status of an argument - Added an `o_version` default argument which prints the parser's version info - Renamed the `argument_descriptor` class to `help_builder` - Fixed an error where the requirements of all arguments within a mutually exclusive group were verified, which caused unexpected exceptions - Added the `logging_mode` and `ap_git` demo projects
1 parent 4fe32f0 commit 4b81d69

21 files changed

+880
-408
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ else()
77
endif()
88

99
project(cpp-ap
10-
VERSION 3.0.0.7
10+
VERSION 3.0.0.8
1111
DESCRIPTION "Command-line argument parser for C++20"
1212
HOMEPAGE_URL "https://github.com/SpectraL519/cpp-ap"
1313
LANGUAGES CXX

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PROJECT_NAME = CPP-AP
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER = 3.0.0.7
51+
PROJECT_NUMBER = 3.0.0.8
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module(
22
name = "cpp-ap",
3-
version = "3.0.0.7",
3+
version = "3.0.0.8",
44
)

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ Command-line argument parser for C++20
5353
- [Downloading the Library](/docs/tutorial.md#downloading-the-library)
5454
- [The Parser Class](/docs/tutorial.md#the-parser-class)
5555
- [Adding Arguments](/docs/tutorial.md#adding-arguments)
56+
- [Syntax](/docs/tutorial.md#syntax)
57+
- [Names](/docs/tutorial.md#names)
58+
- [Value Types](/docs/tutorial.md#value-types)
59+
- [Boolean Flags](/docs/tutorial.md#boolean-flags)
5660
- [Argument Parameters](/docs/tutorial.md#argument-parameters)
5761
- [Common Parameters](/docs/tutorial.md#common-parameters)
5862
- [Parameters Specific for Optional Arguments](/docs/tutorial.md#parameters-specific-for-optional-arguments)
@@ -63,6 +67,11 @@ Command-line argument parser for C++20
6367
- [Compound Arguments](/docs/tutorial.md#compound-arguments)
6468
- [Parsing Known Arguments](/docs/tutorial.md#parsing-known-arguments)
6569
- [Retrieving Argument Values](/docs/tutorial.md#retrieving-argument-values)
70+
- [Subparsers](/docs/tutorial.md#subparsers)
71+
- [Creating Subparsers](/docs/tutorial.md#creating-subparsers)
72+
- [Using Multiple Subparsers](/docs/tutorial.md#using-multiple-subparsers)
73+
- [Parsing Arguments with Subparsers](/docs/tutorial.md#parsing-arguments-with-subparsers)
74+
- [Tracking Parser State](/docs/tutorial.md#tracking-parser-state)
6675
- [Examples](/docs/tutorial.md#examples)
6776
- [Common Utility](/docs/tutorial.md#common-utility)
6877
- [Dev notes](/docs/dev_notes.md#dev-notes)

0 commit comments

Comments
 (0)