mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +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
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include <AK/Function.h>
|
#include <AK/Function.h>
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
@ -54,6 +55,11 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
bool parse(int argc, char* const* argv, FailureBehavior failure_behavior = FailureBehavior::PrintUsageAndExit);
|
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!
|
// *Without* trailing newline!
|
||||||
void set_general_help(const char* help_string) { m_general_help = help_string; };
|
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; }
|
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…
Add table
Add a link
Reference in a new issue