1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:27:34 +00:00

LibCore: Make ArgParser::Option::accept_value return ErrorOr<bool>

This commit makes the `ArgParser::Option::accept_value` property more
error-safe by ensuring it returns an ErrorOr<bool> instead of just a
bool.
This commit is contained in:
Carwyn Nelson 2023-07-01 16:01:30 +01:00 committed by Ali Mohammad Pur
parent 0315ee5937
commit abbfb00a02
2 changed files with 27 additions and 19 deletions

View file

@ -51,7 +51,7 @@ public:
char const* long_name { nullptr };
char short_name { 0 };
char const* value_name { nullptr };
Function<bool(StringView)> accept_value;
Function<ErrorOr<bool>(StringView)> accept_value;
OptionHideMode hide_mode { OptionHideMode::None };
DeprecatedString name_for_display() const