LibCore: Add ignored options to ArgsParser

This commit is contained in:
Jean-Baptiste Boric 2021-10-23 13:44:04 +02:00 committed by Andreas Kling
parent 68c457b601
commit 1b3090bf3c
Notes: sideshowbarker 2024-07-18 02:01:16 +09:00
2 changed files with 16 additions and 0 deletions

View file

@ -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 {

View file

@ -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);