poafloc

Parser Of Arguments For Lines Of Commands
git clone git://git.dimitrijedobrota.com/poafloc.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

commit 0b39a8e355a28efde1daca08416308ffa28cf490
parent 6751c0563a2a6a1ce35df9a3e16d771980cfb282
author Dimitrije Dobrota < mail@dimitrijedobrota.com >
date Sat, 7 Jun 2025 17:05:43 +0200

Catch help exception in parser itself

Diffstat:
M include/poafloc/poafloc.hpp | ++++++++++ --

1 files changed, 10 insertions(+), 2 deletions(-)


diff --git a/ include/poafloc/poafloc.hpp b/ include/poafloc/poafloc.hpp

@@ -552,12 +552,20 @@ struct parser : detail::parser_base


void operator()(Record& record, int argc, const char** argv)
{
parser_base::operator()(&record, argc, argv);
try {
parser_base::operator()(&record, argc, argv);
} catch (const error<error_code::help>& err) {
(void)err;
}
}

void operator()(Record& record, std::span<const std::string_view> args)
{
parser_base::operator()(&record, args);
try {
parser_base::operator()(&record, args);
} catch (const error<error_code::help>& err) {
(void)err;
}
}
};