From 46d91adbdded0f86947195d8676b2febc11473ec Mon Sep 17 00:00:00 2001 From: cobrapitz <12397702+cobrapitz@users.noreply.github.com> Date: Mon, 8 May 2023 03:14:45 +0200 Subject: [PATCH] format exlcude for gcc12 support --- include/cb.h | 3 +++ src/cb/argparser/argument_parser.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/cb.h b/include/cb.h index ef50683..52aec90 100644 --- a/include/cb.h +++ b/include/cb.h @@ -18,6 +18,9 @@ #endif +//#define CB_EXCLUDE_FORMATTED_PRINTS + + #include "cb/test/test.h" #include "cb/time/time.h" #include "cb/types/types.h" diff --git a/src/cb/argparser/argument_parser.cpp b/src/cb/argparser/argument_parser.cpp index 4374b66..aed9436 100644 --- a/src/cb/argparser/argument_parser.cpp +++ b/src/cb/argparser/argument_parser.cpp @@ -186,9 +186,11 @@ 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 += "\n"; } @@ -196,10 +198,12 @@ 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 += "\n"; }