1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:37:34 +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

@ -35,7 +35,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(wait, "Enable profiling and wait for user input to disable.", nullptr, 'w');
args_parser.add_option(cmd_argument, "Command", nullptr, 'c', "command");
args_parser.add_option(Core::ArgsParser::Option {
true, "Enable tracking specific event type", nullptr, 't', "event_type",
Core::ArgsParser::OptionArgumentMode::Required,
"Enable tracking specific event type", nullptr, 't', "event_type",
[&](String event_type) {
seen_event_type_arg = true;
if (event_type == "sample")