From 810b9daa63a0568d60232f11bf36d778dd784b5e Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 12 Jul 2022 22:19:52 +0200 Subject: 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. --- Userland/Libraries/LibCore/ArgsParser.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Userland/Libraries/LibCore') 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, "* "); -- cgit v1.2.3