1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17: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

@ -288,7 +288,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
parser.add_option(export_all_imports, "Export noop functions corresponding to imports", "export-noop", 0);
parser.add_option(shell_mode, "Launch a REPL in the module's context (implies -i)", "shell", 's');
parser.add_option(Core::ArgsParser::Option {
.requires_argument = true,
.argument_mode = Core::ArgsParser::OptionArgumentMode::Required,
.help_string = "Extra modules to link with, use to resolve imports",
.long_name = "link",
.short_name = 'l',
@ -302,7 +302,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
},
});
parser.add_option(Core::ArgsParser::Option {
.requires_argument = true,
.argument_mode = Core::ArgsParser::OptionArgumentMode::Required,
.help_string = "Supply arguments to the function (default=0) (expects u64, casts to required type)",
.long_name = "arg",
.short_name = 0,