From 6bdbbaf182ac77633aa97dfe785c37802809acc2 Mon Sep 17 00:00:00 2001 From: cobrapitz <12397702+cobrapitz@users.noreply.github.com> Date: Mon, 8 May 2023 03:43:08 +0200 Subject: [PATCH] format exlcude for gcc12 support --- include/cb.h | 2 -- src/cb/argparser/argument_parser.cpp | 17 ++--------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/include/cb.h b/include/cb.h index 52aec90..cb94a72 100644 --- a/include/cb.h +++ b/include/cb.h @@ -18,8 +18,6 @@ #endif -//#define CB_EXCLUDE_FORMATTED_PRINTS - #include "cb/test/test.h" #include "cb/time/time.h" diff --git a/src/cb/argparser/argument_parser.cpp b/src/cb/argparser/argument_parser.cpp index 68fc44d..282e360 100644 --- a/src/cb/argparser/argument_parser.cpp +++ b/src/cb/argparser/argument_parser.cpp @@ -2,10 +2,6 @@ #include "cb/argparser/argument_parser.h" #include "cb/argparser/argument.h" -#ifndef CB_EXCLUDE_FORMATTED_PRINTS -#include -#endif - cb::argparser::Argument::Argument(std::string content, cb::argparser::Type type) : content{std::move(content)}, type{type} { if (type == Type::BOOL_TYPE && this->content == "false") { this->content = ""; @@ -187,11 +183,7 @@ std::string cb::argparser::ArgumentParser::get_help() { if (not positional_arguments.empty()) { help_message += "Positional Arguments:\n"; for (auto &&arg: positional_arguments) { -#ifndef CB_EXCLUDE_FORMATTED_PRINTS - help_message += std::format("{:15} {}\n", - arg.name, - arg.description); -#endif + help_message += arg.name + ": " + arg.description + "\n"; } help_message += "\n"; } @@ -199,12 +191,7 @@ std::string cb::argparser::ArgumentParser::get_help() { if (not arguments.empty()) { help_message += "Arguments:\n"; for (auto &&arg: arguments) { -#ifndef CB_EXCLUDE_FORMATTED_PRINTS - help_message += std::format("{:5} {:15} {}\n", - arg.short_name, - arg.name, - arg.description); -#endif + help_message += arg.short_name + " " + arg.name + ": " + arg.description + "\n"; } help_message += "\n"; }