mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibCore: Let ArgsParser::parse() accept Main::Arguments
Instead of manually passing in `arguments.argc` and `arguments.argv`, we can now just pass in the arguments directly.
This commit is contained in:
parent
a0ef655451
commit
7720644ae2
Notes:
sideshowbarker
2024-07-18 00:50:16 +09:00
Author: https://github.com/mustafaquraish Commit: https://github.com/SerenityOS/serenity/commit/7720644ae2c Pull-request: https://github.com/SerenityOS/serenity/pull/11027
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <AK/Function.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <stdio.h>
|
||||
|
||||
namespace Core {
|
||||
|
@ -54,6 +55,11 @@ public:
|
|||
};
|
||||
|
||||
bool parse(int argc, char* const* argv, FailureBehavior failure_behavior = FailureBehavior::PrintUsageAndExit);
|
||||
bool parse(Main::Arguments const& arguments, FailureBehavior failure_behavior = FailureBehavior::PrintUsageAndExit)
|
||||
{
|
||||
return parse(arguments.argc, arguments.argv, failure_behavior);
|
||||
}
|
||||
|
||||
// *Without* trailing newline!
|
||||
void set_general_help(const char* help_string) { m_general_help = help_string; };
|
||||
void set_stop_on_first_non_option(bool stop_on_first_non_option) { m_stop_on_first_non_option = stop_on_first_non_option; }
|
||||
|
|
Loading…
Reference in a new issue