mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00: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
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