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

LibCore: Replace the ArgsParser option argument setting with an enum

Replacement conditions for `requires_argument` have been chosen based
on what would be most convenient for implementing an eventual optional
argument mode.
This commit is contained in:
Tim Schumacher 2022-07-12 22:13:38 +02:00 committed by Linus Groh
parent 810b9daa63
commit 3d51642037
15 changed files with 59 additions and 53 deletions

View file

@ -30,6 +30,11 @@ public:
Ignore,
};
enum class OptionArgumentMode {
None,
Required,
};
/// When an option is hidden.
/// If the hide mode is not None, then it's always hidden from the usage/synopsis.
enum class OptionHideMode {
@ -39,7 +44,7 @@ public:
};
struct Option {
bool requires_argument { true };
OptionArgumentMode argument_mode { OptionArgumentMode::Required };
char const* help_string { nullptr };
char const* long_name { nullptr };
char short_name { 0 };