mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 18:24:45 -05:00
LibCore: Add ignored options to ArgsParser
This commit is contained in:
parent
68c457b601
commit
1b3090bf3c
Notes:
sideshowbarker
2024-07-18 02:01:16 +09:00
Author: https://github.com/boricj Commit: https://github.com/SerenityOS/serenity/commit/1b3090bf3c0 Pull-request: https://github.com/SerenityOS/serenity/pull/10594
2 changed files with 16 additions and 0 deletions
|
@ -253,6 +253,21 @@ void ArgsParser::add_option(Option&& option)
|
|||
m_options.append(move(option));
|
||||
}
|
||||
|
||||
void ArgsParser::add_ignored(const char* long_name, char short_name)
|
||||
{
|
||||
Option option {
|
||||
false,
|
||||
"Ignored",
|
||||
long_name,
|
||||
short_name,
|
||||
nullptr,
|
||||
[](const char*) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
add_option(move(option));
|
||||
}
|
||||
|
||||
void ArgsParser::add_option(bool& value, const char* help_string, const char* long_name, char short_name)
|
||||
{
|
||||
Option option {
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
void print_version(FILE*);
|
||||
|
||||
void add_option(Option&&);
|
||||
void add_ignored(const char* long_name, char short_name);
|
||||
void add_option(bool& value, const char* help_string, const char* long_name, char short_name);
|
||||
void add_option(const char*& value, const char* help_string, const char* long_name, char short_name, const char* value_name);
|
||||
void add_option(String& value, const char* help_string, const char* long_name, char short_name, const char* value_name);
|
||||
|
|
Loading…
Add table
Reference in a new issue