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

@@ -15,7 +15,7 @@ namespace argument_parser {
}
namespace v2 {
linux_parser::linux_parser() {
linux_parser::linux_parser(bool should_exit) {
std::ifstream command_line_file{"/proc/self/cmdline"};
std::string program_name;
std::getline(command_line_file, program_name, '\0');
@@ -25,7 +25,7 @@ namespace argument_parser {
parsed_arguments.emplace_back(line);
}
prepare_help_flag();
prepare_help_flag(should_exit);
}
} // namespace v2
} // namespace argument_parser