Skip to content

Commit a3d148b

Browse files
committed
Renamed the workflow jobs
1 parent f7fb690 commit a3d148b

8 files changed

Lines changed: 40 additions & 37 deletions

File tree

.github/workflows/demo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: demo
1+
name: CPP-ARGON Demo
22
on:
33
push:
44
branches:

.github/workflows/documentation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: documentation
1+
name: Documentation
22

33
on:
44
pull_request:

.github/workflows/format.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: format
1+
name: Code Formatting
22
on:
33
push:
44
branches:

.github/workflows/license.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: license
1+
name: License
22
on:
33
push:
44
branches:

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ FULL_PATH_NAMES = YES
190190
# will be relative from the directory where doxygen is started.
191191
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
192192

193-
STRIP_FROM_PATH =
193+
STRIP_FROM_PATH = .
194194

195195
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
196196
# path mentioned in the documentation of a class, which tells the reader which

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
<div align="center">
1818

19-
[![format](https://github.com/SpectraL519/cpp-argon/actions/workflows/format.yaml/badge.svg)](https://github.com/SpectraL519/cpp-argon/actions/workflows/format)
20-
[![demo](https://github.com/SpectraL519/cpp-argon/actions/workflows/demo.yaml/badge.svg)](https://github.com/SpectraL519/cpp-argon/actions/workflows/demo)
21-
[![documentation](https://github.com/SpectraL519/cpp-argon/actions/workflows/documentation.yaml/badge.svg)](https://github.com/SpectraL519/cpp-argon/actions/workflows/documentation)
22-
[![changelog](https://img.shields.io/badge/changelog-blue.svg?logo=github)](https://github.com/SpectraL519/cpp-argon/releases)
19+
[![Code Formatting](https://github.com/SpectraL519/cpp-argon/actions/workflows/format.yaml/badge.svg)](https://github.com/SpectraL519/cpp-argon/actions/workflows/format)
20+
[![CPP-ARGON Demo](https://github.com/SpectraL519/cpp-argon/actions/workflows/demo.yaml/badge.svg)](https://github.com/SpectraL519/cpp-argon/actions/workflows/demo)
21+
[![Documentation](https://github.com/SpectraL519/cpp-argon/actions/workflows/documentation.yaml/badge.svg)](https://github.com/SpectraL519/cpp-argon/actions/workflows/documentation)
22+
[![Changelog](https://img.shields.io/badge/changelog-blue.svg?logo=github)](https://github.com/SpectraL519/cpp-argon/releases)
2323

2424
</div>
2525

docs/tutorial.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@
1212
- [Boolean Flags](#boolean-flags)
1313
- [Argument Parameters](#argument-parameters)
1414
- [Common Parameters](#common-parameters)
15-
- [help](#1-help---the-arguments-description-which-will-be-printed-when-printing-the-parser-class-instance) - the text shown in the help message to describe an argument
16-
- [hidden](#2-hidden---if-this-option-is-set-for-an-argument-then-it-will-not-be-included-in-the-program-description) - hides the argument from the generated program description and help output
17-
- [required](#3-required---if-this-option-is-set-for-an-argument-and-its-value-is-not-passed-in-the-command-line-an-exception-will-be-thrown) - marks the argument as mandatory; not using it will cause an error
18-
- [suppress arg checks](#4-suppress_arg_checks---using-a-suppressing-argument-results-in-suppressing-requirement-checks-for-other-arguments) - if a suppressing argument is used, other requirement validation will be skipped for other arguments
19-
- [nargs](#5-nargs---sets-the-allowed-number-of-values-to-be-parsed-for-an-argument) - defines how many values an argument can or must accept
20-
- [greedy](#6-greedy---if-this-option-is-set-the-argument-will-consume-all-command-line-values-until-its-upper-nargs-bound-is-reached) - makes the argument consume all following values until its limit is reached
21-
- [choices](#7-choices---a-list-of-valid-argument-values) - restricts the valid inputs to a predefined set of values
22-
- [value actions](#8-value-actions---functions-that-are-called-after-parsing-an-arguments-value) - allows you to run custom code after the argument’s value is parsed
23-
- [default values](#9-default_values---a-list-of-values-which-will-be-used-if-no-values-for-an-argument-have-been-parsed) - specifies fallback values to use if none are provided
15+
- [Help - The argument's description which will be printed when printing the parser class instance.](#help---the-arguments-description-which-will-be-printed-when-printing-the-parser-class-instance)
16+
- [Hidden - If this option is set for an argument, then it will not be included in the program description.](#hidden---if-this-option-is-set-for-an-argument-then-it-will-not-be-included-in-the-program-description)
17+
- [Required - If this option is set for an argument and it's value is not passed in the command-line, an exception will be thrown.](#required---if-this-option-is-set-for-an-argument-and-its-value-is-not-passed-in-the-command-line-an-exception-will-be-thrown)
18+
- [Argument Checks Suppression - Using a suppressing argument results in suppressing requirement checks for other arguments.](#argument-checks-suppression---using-a-suppressing-argument-results-in-suppressing-requirement-checks-for-other-arguments)
19+
- [Number of Arguments - Sets the allowed number of values to be parsed for an argument.](#number-of-arguments---sets-the-allowed-number-of-values-to-be-parsed-for-an-argument)
20+
- [Greedy Parsing - If this option is set, the argument will consume ALL command-line values until it's upper nargs bound is reached.](#greedy-parsing---if-this-option-is-set-the-argument-will-consume-all-command-line-values-until-its-upper-nargs-bound-is-reached)
21+
- [Choices - A list of valid argument values.](#choices---a-list-of-valid-argument-values)
22+
- [Value Actions - Functions that are called after parsing an argument's value.](#value-actions---functions-that-are-called-after-parsing-an-arguments-value)
23+
- [Default Values - A list of values which will be used if no values for an argument have been parsed](#default-values---a-list-of-values-which-will-be-used-if-no-values-for-an-argument-have-been-parsed)
2424
- [Parameters Specific for Optional Arguments](#parameters-specific-for-optional-arguments)
25-
- [on-flag actions](#1-on-flag-actions---functions-that-are-called-immediately-after-parsing-an-arguments-flag) - executes custom code immediately when the argument’s flag is present
26-
- [implicit values](#2-implicit_values---a-list-of-values-which-will-be-set-for-an-argument-if-only-its-flag-but-no-values-are-parsed-from-the-command-line) - automatically assigns a value if an argument flag is used without an explicit value
25+
- [On-flag Actions - Functions that are called immediately after parsing an argument's flag.](#on-flag-actions---functions-that-are-called-immediately-after-parsing-an-arguments-flag)
26+
- [Implicit Values - A list of values which will be set for an argument if only its flag but no values are parsed from the command-line.](#implicit-values---a-list-of-values-which-will-be-set-for-an-argument-if-only-its-flag-but-no-values-are-parsed-from-the-command-line)
2727
- [Predefined Parameter Values](#predefined-parameter-values)
28+
- [Actions](#actions)
2829
- [Default Arguments](#default-arguments)
2930
- [Argument Groups](#argument-groups)
3031
- [Creating New Groups](#creating-new-groups)
@@ -34,6 +35,10 @@
3435
- [Suppressing Argument Group Checks](#suppressing-argument-group-checks)
3536
- [Parsing Arguments](#parsing-arguments)
3637
- [Basic Argument Parsing Rules](#basic-argument-parsing-rules)
38+
- [1. Optional arguments are parsed only with a flag](#1-optional-arguments-are-parsed-only-with-a-flag)
39+
- [2. Positional arguments are parsed in the order of definition](#2-positional-arguments-are-parsed-in-the-order-of-definition)
40+
- [3. Positional arguments consume free values](#3-positional-arguments-consume-free-values)
41+
- [4. Unknown Argument Flag Handling](#4-unknown-argument-flag-handling)
3742
- [Compound Arguments](#compound-arguments)
3843
- [Parsing Known Arguments](#parsing-known-arguments)
3944
- [Retrieving Argument Values](#retrieving-argument-values)
@@ -42,6 +47,7 @@
4247
- [Using Multiple Subparsers](#using-multiple-subparsers)
4348
- [Parsing Arguments with Subparsers](#parsing-arguments-with-subparsers)
4449
- [Tracking Parser State](#tracking-parser-state)
50+
- [Example: Inspecting Parsing States](#example-inspecting-parsing-states)
4551
- [Examples](#examples)
4652
- [Common Utility](#common-utility)
4753

@@ -256,7 +262,6 @@ parser.add_optional_argument<bool>("disable_another_option", "dao")
256262
.nargs(0)
257263
.help("disables option: another option");
258264
*/
259-
260265
```
261266

262267
<br/>
@@ -269,7 +274,7 @@ parser.add_optional_argument<bool>("disable_another_option", "dao")
269274

270275
Parameters which can be specified for both positional and optional arguments include:
271276

272-
#### 1. `help` - The argument's description which will be printed when printing the parser class instance.
277+
#### Help - The argument's description which will be printed when printing the parser class instance.
273278

274279
```cpp
275280
parser.add_positional_argument<std::size_t>("number", "n")
@@ -278,7 +283,7 @@ parser.add_positional_argument<std::size_t>("number", "n")
278283

279284
<br />
280285

281-
#### 2. `hidden` - If this option is set for an argument, then it will not be included in the program description.
286+
#### Hidden - If this option is set for an argument, then it will not be included in the program description.
282287

283288
By default all arguments are visible, but this can be modified using the `hidden(bool)` setter as follows:
284289

@@ -309,7 +314,7 @@ Optional arguments:
309314
310315
<br />
311316
312-
#### 3. `required` - If this option is set for an argument and it's value is not passed in the command-line, an exception will be thrown.
317+
#### Required - If this option is set for an argument and it's value is not passed in the command-line, an exception will be thrown.
313318
314319
> [!IMPORTANT]
315320
>
@@ -376,7 +381,7 @@ Command Result
376381

377382
<br />
378383

379-
#### 4. `suppress_arg_checks` - Using a suppressing argument results in suppressing requirement checks for other arguments.
384+
#### Argument Checks Suppression - Using a suppressing argument results in suppressing requirement checks for other arguments.
380385

381386
If an argument is defined with the `suppress_arg_checks` option enabled and such argument is explicitly used in the command-line, then requirement validation will be suppressed/skipped for other arguments. This includes validating whether:
382387
- a required argument has been parsed
@@ -417,7 +422,7 @@ os << data << std::endl;
417422
418423
<br />
419424
420-
#### 5. `nargs` - Sets the allowed number of values to be parsed for an argument.
425+
#### Number of Arguments - Sets the allowed number of values to be parsed for an argument.
421426
422427
The `nargs` parameter can be set as:
423428
@@ -458,7 +463,7 @@ The `nargs` parameter can be set as:
458463
459464
<br />
460465

461-
#### 6. `greedy` - If this option is set, the argument will consume ALL command-line values until it's upper nargs bound is reached.
466+
#### Greedy Parsing - If this option is set, the argument will consume ALL command-line values until it's upper nargs bound is reached.
462467

463468
> [!NOTE]
464469
>
@@ -499,7 +504,7 @@ Notice that even though the `-v` and `--type` command-line arguments have flag p
499504

500505
<br />
501506

502-
#### 7. `choices` - A list of valid argument values.
507+
#### Choices - A list of valid argument values.
503508

504509
```cpp
505510
parser.add_optional_argument<char>("method", "m").choices('a', 'b', 'c');
@@ -516,7 +521,7 @@ parser.add_optional_argument<char>("method", "m").choices('a', 'b', 'c');
516521
517522
<br />
518523

519-
#### 8. value actions - Functions that are called after parsing an argument's value.
524+
#### Value Actions - Functions that are called after parsing an argument's value.
520525
Actions are represented as functions, which take the argument's value as an argument. The available action types are:
521526

522527
- `observe` actions | `void(const value_type&)` - applied to the parsed value. No value is returned - this action type is used to perform some logic on the parsed value without modifying it.
@@ -561,7 +566,7 @@ Actions are represented as functions, which take the argument's value as an argu
561566
562567
<br />
563568
564-
#### 9. `default_values` - A list of values which will be used if no values for an argument have been parsed
569+
#### Default Values - A list of values which will be used if no values for an argument have been parsed
565570
566571
> [!WARNING]
567572
>
@@ -624,7 +629,7 @@ Command Result
624629
625630
Apart from the common parameters listed above, for optional arguments you can also specify the following parameters:
626631
627-
#### 1. on-flag actions - Functions that are called immediately after parsing an argument's flag.
632+
#### On-flag Actions - Functions that are called immediately after parsing an argument's flag.
628633
629634
```cpp
630635
void print_debug_info() noexcept {
@@ -644,7 +649,7 @@ Here the `print_debug_info` function will be called right after parsing the `--d
644649

645650
<br />
646651

647-
#### 2. `implicit_values` - A list of values which will be set for an argument if only its flag but no values are parsed from the command-line.
652+
#### Implicit Values - A list of values which will be set for an argument if only its flag but no values are parsed from the command-line.
648653

649654
```cpp
650655
// example
@@ -1607,8 +1612,8 @@ The following table lists the projects provided in the `cpp-argon-demo` submodul
16071612
| [Numbers Converter](https://github.com/SpectraL519/cpp-argon-demo/tree/master/numbers_converter/) | Converts numbers between different bases.<br/>**Demonstrates:** The usage of argument parameters such as *nargs*, *choices*, and *default values*. |
16081613
| [Verbosity](https://github.com/SpectraL519/cpp-argon-demo/tree/master/verbosity/) | Prints messages with varying levels of verbosity.<br/>**Demonstrates:** The usage of `none_type` arguments and compound argument flags. |
16091614
| [Logging Mode](https://github.com/SpectraL519/cpp-argon-demo/tree/master/logging_mode/) | Logs a message depending on the selected logging mode (`quiet`, `normal`, `verbose`).<br/>**Demonstrates:** The usage of custom argument value types (like enums). |
1610-
| [Message Logger](https://github.com/SpectraL519/cpp-argon-demo/arg_parsertree/master/message_logger/) | Outputs a message to a file, console, or not at all.<br/>**Demonstrates:** The usage of argument groups. |
1611-
| [AP-GIT](https://github.com/SpectraL519/cpp-argon-demo/tree/master/ap_git/) | A minimal Git CLI clone with subcommands (`init`, `add`, `commit`, `status`, `push`).<br/>**Demonstrates:** The usage of subparsers for multi-command CLIs and complex argument configurations. |
1615+
| [Message Logger](https://github.com/SpectraL519/cpp-argon-demo/tree/master/message_logger/) | Outputs a message to a file, console, or not at all.<br/>**Demonstrates:** The usage of argument groups. |
1616+
| [ARGON-GIT](https://github.com/SpectraL519/cpp-argon-demo/tree/master/argon_git/) | A minimal Git CLI clone with subcommands (`init`, `add`, `commit`, `status`, `push`).<br/>**Demonstrates:** The usage of subparsers for multi-command CLIs and complex argument configurations. |
16121617
16131618
<br/>
16141619
<br/>

include/argon/argument_parser.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void add_default_argument(const default_argument, argument_parser&) noexcept;
148148
* This class provides methods to define positional and optional arguments, set parser options,
149149
* and parse the command-line input.
150150
*
151-
* Example usage:
151+
* ## Basic Usage:
152152
* @code{.cpp}
153153
* #include <argon/argument_parser.hpp>
154154
*
@@ -175,7 +175,6 @@ void add_default_argument(const default_argument, argument_parser&) noexcept;
175175
*
176176
* return 0;
177177
* }
178-
* @endcode
179178
*/
180179
class argument_parser {
181180
public:
@@ -700,7 +699,6 @@ class argument_parser {
700699
* - For top-level parsers, this is the same as the parser's name.
701700
* - For subparsers, the name is prefixed with its parent parser names.
702701
*
703-
* @example
704702
* Top-level parser: `git`
705703
* Subparser: `git submodule`
706704
* Nested subparser : `git submodule init`

0 commit comments

Comments
 (0)