1
0

fix: fix clap and its test.

- fix clap test compile and running issue.
- fix unexpected output in console for clap manual.
- remove duplicated program name in clap manual.
- fix there is no default ctor for clap validator.
- fix fatal scoped pointer return in clap parser and resolver.
This commit is contained in:
2025-12-11 19:57:48 +08:00
parent 6a97b13f66
commit 6b29b7f715
8 changed files with 30 additions and 20 deletions

View File

@ -77,7 +77,7 @@ namespace yycc::carton::clap::resolver {
return false;
} else {
// Found.
auto val = finder->second;
const auto& val = finder->second;
if (val.has_value()) throw std::logic_error("get flag variable as value variable.");
else return true;
}
@ -90,7 +90,7 @@ namespace yycc::carton::clap::resolver {
return std::unexpected(TYPES::ClapError::NotCaptured);
} else {
// Found.
auto val = finder->second;
const auto& val = finder->second;
if (val.has_value()) return std::u8string_view(val.value());
else throw std::logic_error("get value variable as flag variable.");
}