Add should_exit support for v2 parsers

- Add should_exit support to v2 platform parsers
- Introduce macros.h and integrate trait hints
- Wire CMake packaging with config, version, and install dirs
- Update parser traits to include validation hooks and fixes
This commit is contained in:
2026-04-20 18:43:44 +04:00
parent 5e1f203713
commit 2d018e94d5
16 changed files with 245 additions and 86 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "parser_v2.hpp"
#ifndef FAKE_PARSER_HPP
#define FAKE_PARSER_HPP
@@ -18,6 +19,19 @@ namespace argument_parser {
void set_program_name(std::string const &program_name);
void set_parsed_arguments(std::vector<std::string> const &parsed_arguments);
};
namespace v2 {
class fake_parser : public argument_parser::v2::base_parser {
public:
fake_parser() = default;
fake_parser(std::string program_name, std::vector<std::string> const &arguments);
fake_parser(std::string const &program_name, std::vector<std::string> &&arguments);
fake_parser(std::string const &program_name, std::initializer_list<std::string> const &arguments);
void set_program_name(std::string const &program_name);
void set_parsed_arguments(std::vector<std::string> const &parsed_arguments);
};
}
} // namespace argument_parser
#endif
#endif