mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibCore: Don't print optional arguments in ArgsParser help messages
This fixes a misconception in our current `ArgsParser` implementation. If `requires_argument` is false, it doesn't mean that the argument is optional (i.e. "not required"). It means that there is no argument at all.
This commit is contained in:
parent
400ef9913e
commit
810b9daa63
Notes:
sideshowbarker
2024-07-17 22:01:16 +09:00
Author: https://github.com/timschumi
Commit: 810b9daa63
Pull-request: https://github.com/SerenityOS/serenity/pull/14571
Reviewed-by: https://github.com/linusg ✅
1 changed files with 0 additions and 4 deletions
|
@ -235,8 +235,6 @@ void ArgsParser::print_usage_terminal(FILE* file, char const* argv0)
|
|||
if (opt.value_name) {
|
||||
if (opt.requires_argument)
|
||||
out(file, " {}", opt.value_name);
|
||||
else
|
||||
out(file, " [{}]", opt.value_name);
|
||||
}
|
||||
};
|
||||
out(file, "\t");
|
||||
|
@ -324,8 +322,6 @@ void ArgsParser::print_usage_markdown(FILE* file, char const* argv0)
|
|||
if (opt.value_name != nullptr) {
|
||||
if (opt.requires_argument)
|
||||
out(file, " {}", opt.value_name);
|
||||
else
|
||||
out(file, " [{}]", opt.value_name);
|
||||
}
|
||||
};
|
||||
out(file, "* ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue