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

@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
parser.add_option(permissions, "Apply these permissions going forward", "permissions", 'p', "unveil-permissions");
parser.add_option(should_sleep, "Sleep after processing all arguments", "sleep", 's');
parser.add_option(Core::ArgsParser::Option {
.requires_argument = true,
.argument_mode = Core::ArgsParser::OptionArgumentMode::Required,
.help_string = "Add a path to the unveil list",
.long_name = "unveil",
.short_name = 'u',
@ -37,7 +37,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return true;
} });
parser.add_option(Core::ArgsParser::Option {
.requires_argument = false,
.argument_mode = Core::ArgsParser::OptionArgumentMode::None,
.help_string = "Lock the veil",
.long_name = "lock",
.short_name = 'l',