diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-07-12 22:19:52 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-07-14 00:24:24 +0100 |
commit | 810b9daa63a0568d60232f11bf36d778dd784b5e (patch) | |
tree | 067680faac25ce3a1bfc6bf82acdf32c5bc9cb82 | |
parent | 400ef9913e340affb45ad134e049fa313ade0b00 (diff) | |
download | serenity-810b9daa63a0568d60232f11bf36d778dd784b5e.zip |
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.
-rw-r--r-- | Userland/Libraries/LibCore/ArgsParser.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp index 8da40ba520..943fa800f6 100644 --- a/Userland/Libraries/LibCore/ArgsParser.cpp +++ b/Userland/Libraries/LibCore/ArgsParser.cpp @@ -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, "* "); |