From 956026bb6b20b8f4810404aaa373abb746f73910 Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Thu, 12 Jan 2023 14:12:05 -0500 Subject: [PATCH] Break long lines of option help (#13136) --- src/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e9b320af7..35dcb708b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -389,12 +389,14 @@ static void print_help(const OptionList &allowed_options) static void print_allowed_options(const OptionList &allowed_options) { for (const auto &allowed_option : allowed_options) { - std::ostringstream os1(std::ios::binary); - os1 << " --" << allowed_option.first; + std::string opt = " --" + allowed_option.first; if (allowed_option.second.type != VALUETYPE_FLAG) - os1 << _(" "); + opt += _(" "); - std::cout << padStringRight(os1.str(), 30); + std::string opt_padded = padStringRight(opt, 30); + std::cout << opt_padded; + if (opt == opt_padded) // Line is too long to pad + std::cout << std::endl << padStringRight("", 30); if (allowed_option.second.help) std::cout << allowed_option.second.help;