mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 04:50:29 +00:00
LibCore: Make short_name optional for ArgsParser
This allows us to not need to pass through a 0 in many cases for options which do not support a short value.
This commit is contained in:
parent
59c79e848c
commit
88b343061e
Notes:
sideshowbarker
2024-07-17 02:38:39 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/88b343061e Pull-request: https://github.com/SerenityOS/serenity/pull/24047
1 changed files with 3 additions and 3 deletions
|
@ -85,11 +85,11 @@ public:
|
|||
void print_version(FILE*);
|
||||
|
||||
void add_option(Option&&);
|
||||
void add_ignored(char const* long_name, char short_name, OptionHideMode hide_mode = OptionHideMode::None);
|
||||
void add_option(bool& value, char const* help_string, char const* long_name, char short_name, OptionHideMode hide_mode = OptionHideMode::None);
|
||||
void add_ignored(char const* long_name, char short_name = 0, OptionHideMode hide_mode = OptionHideMode::None);
|
||||
void add_option(bool& value, char const* help_string, char const* long_name, char short_name = 0, OptionHideMode hide_mode = OptionHideMode::None);
|
||||
/// If the option is present, set the enum to have the given `new_value`.
|
||||
template<Enum T>
|
||||
void add_option(T& value, T new_value, char const* help_string, char const* long_name, char short_name, OptionHideMode hide_mode = OptionHideMode::None)
|
||||
void add_option(T& value, T new_value, char const* help_string, char const* long_name, char short_name = 0, OptionHideMode hide_mode = OptionHideMode::None)
|
||||
{
|
||||
add_option({ .argument_mode = Core::ArgsParser::OptionArgumentMode::None,
|
||||
.help_string = help_string,
|
||||
|
|
Loading…
Reference in a new issue