1
0
Fork 0
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:
Tim Schumacher 2022-07-12 22:19:52 +02:00 committed by Linus Groh
parent 400ef9913e
commit 810b9daa63
Notes: sideshowbarker 2024-07-17 22:01:16 +09:00

View file

@ -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, "* ");