|
|
|
@ -2,10 +2,6 @@
|
|
|
|
#include "cb/argparser/argument_parser.h"
|
|
|
|
#include "cb/argparser/argument_parser.h"
|
|
|
|
#include "cb/argparser/argument.h"
|
|
|
|
#include "cb/argparser/argument.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef CB_EXCLUDE_FORMATTED_PRINTS
|
|
|
|
|
|
|
|
#include <format>
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cb::argparser::Argument::Argument(std::string content, cb::argparser::Type type) : content{std::move(content)}, type{type} {
|
|
|
|
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") {
|
|
|
|
if (type == Type::BOOL_TYPE && this->content == "false") {
|
|
|
|
this->content = "";
|
|
|
|
this->content = "";
|
|
|
|
@ -187,11 +183,7 @@ std::string cb::argparser::ArgumentParser::get_help() {
|
|
|
|
if (not positional_arguments.empty()) {
|
|
|
|
if (not positional_arguments.empty()) {
|
|
|
|
help_message += "Positional Arguments:\n";
|
|
|
|
help_message += "Positional Arguments:\n";
|
|
|
|
for (auto &&arg: positional_arguments) {
|
|
|
|
for (auto &&arg: positional_arguments) {
|
|
|
|
#ifndef CB_EXCLUDE_FORMATTED_PRINTS
|
|
|
|
help_message += arg.name + ": " + arg.description + "\n";
|
|
|
|
help_message += std::format("{:15} {}\n",
|
|
|
|
|
|
|
|
arg.name,
|
|
|
|
|
|
|
|
arg.description);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
help_message += "\n";
|
|
|
|
help_message += "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -199,12 +191,7 @@ std::string cb::argparser::ArgumentParser::get_help() {
|
|
|
|
if (not arguments.empty()) {
|
|
|
|
if (not arguments.empty()) {
|
|
|
|
help_message += "Arguments:\n";
|
|
|
|
help_message += "Arguments:\n";
|
|
|
|
for (auto &&arg: arguments) {
|
|
|
|
for (auto &&arg: arguments) {
|
|
|
|
#ifndef CB_EXCLUDE_FORMATTED_PRINTS
|
|
|
|
help_message += arg.short_name + " " + arg.name + ": " + arg.description + "\n";
|
|
|
|
help_message += std::format("{:5} {:15} {}\n",
|
|
|
|
|
|
|
|
arg.short_name,
|
|
|
|
|
|
|
|
arg.name,
|
|
|
|
|
|
|
|
arg.description);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
help_message += "\n";
|
|
|
|
help_message += "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|