Skip to content

Commit

Permalink
CPP-AP: version 1.1
Browse files Browse the repository at this point in the history
- Introduced CMake integration
- Formatting scripts improvement
- Small code refactor including:
    - `argument_name` class refactor
    - Added aliases for default positional and optional arguments discriminator structures
    - Utilizing the `std::ranges` library for operations on collections
- Cleaned the commit history
  • Loading branch information
SpectraL519 committed May 16, 2024
1 parent 45a4648 commit ca75a97
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
32 changes: 18 additions & 14 deletions change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,21 @@

### Version 1.1

* Added `change_log.md`
* Reorganized project folder strucure:
* Renamed folders `src` to `source`
* Moved formatting scripts to `scripts/format/`
* Aligned the `.clang-format` configuration file
* Added the `install_clang17_toolchain.sh` env script
* Added the `format` workflow
* Switched to the `std::ranges` and `std::views` algorithms for all current container operations
* Modified the `argument_name` structure - renamed members: `name` to `primary`, `short_name` to `secondary`
* Added `argument_name::match(string_view)` and `argument_name::match(argument_name)` functions
* Added aliases for default argument enum classes:
* `ap::default_argument::positional` = `ap::default_posarg`
* `ap::default_argument::optional` = `ap::default_optarg`
* Renamed the predefined: `ap::action::check_file_exists_action` -> `ap::action::check_file_exists`
* General:
* Added `change_log.md`
* Reorganized project folder strucure:
* Renamed folders `src` to `source`
* Moved formatting scripts to `scripts/format/`
* Switched to the `std::ranges` and `std::views` algorithms for all current container operations
* Modified the `argument_name` structure - renamed members: `name` to `primary`, `short_name` to `secondary`
* Added `argument_name::match(string_view)` and `argument_name::match(argument_name)` functions
* Added aliases for default argument enum classes:
* `ap::default_argument::positional` = `ap::default_posarg`
* `ap::default_argument::optional` = `ap::default_optarg`
* Renamed the predefined: `ap::action::check_file_exists_action` -> `ap::action::check_file_exists`
* Formatting:
* Aligned the `.clang-format` configuration file
* Added the `install_clang17_toolchain.sh` env script
* Added the `format` workflow
* New features:
* Added the root `CMakeLists.txt` and `cmake/cpp-ap-config.cmake.in` files to enable CMake integration for the library
10 changes: 4 additions & 6 deletions test/source/test_argument_parser_add_argument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ constexpr std::string_view other_secondary_name = "o";
TEST_SUITE_BEGIN("test_argument_parser_add_argument");

TEST_CASE_FIXTURE(argument_parser_test_fixture, "default_positional_arguments should add the specified arguments") {
sut.default_positional_arguments(
{ ap::default_argument::positional::input, ap::default_argument::positional::output }
);
sut.default_positional_arguments({ ap::default_posarg::input, ap::default_posarg::output });

const auto input_arg = sut_get_argument("input");
REQUIRE(input_arg);
Expand All @@ -37,9 +35,9 @@ TEST_CASE_FIXTURE(argument_parser_test_fixture, "default_positional_arguments sh

TEST_CASE_FIXTURE(argument_parser_test_fixture, "default_optional_arguments should add the specified arguments") {
sut.default_optional_arguments(
{ ap::default_argument::optional::help,
ap::default_argument::optional::input,
ap::default_argument::optional::output }
{ ap::default_optarg::help,
ap::default_optarg::input,
ap::default_optarg::output }
);

std::string help_flag;
Expand Down

0 comments on commit ca75a97

Please sign in to comment.