Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/argparse_formatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace argparse {

std::stringstream ss;
ss << "\n";
for(auto& line : wrap_width(parser_->description(), total_width_)) {
for(auto& line : wrap_width(parser_->description(), total_width_, {" ", "/"})) {
ss << line;
}
ss << "\n";
Expand Down Expand Up @@ -132,7 +132,7 @@ namespace argparse {
}

//Argument help
auto help_lines = wrap_width(arg->help(), total_width_ - option_name_width_);
auto help_lines = wrap_width(arg->help(), total_width_ - option_name_width_, {" ", "/"});
for (auto& line : help_lines) {
//Pad out the help
assert(pos <= option_name_width_);
Expand All @@ -156,7 +156,7 @@ namespace argparse {
if (!group.epilog().empty()) {
ss << "\n";

auto epilog_lines = wrap_width(group.epilog(), total_width_ - INDENT.size());
auto epilog_lines = wrap_width(group.epilog(), total_width_ - INDENT.size(), {" ", "/"});
for (auto& line : epilog_lines) {
ss << INDENT << line;
}
Expand All @@ -173,7 +173,7 @@ namespace argparse {

std::stringstream ss;
ss << "\n";
for(auto& line : wrap_width(parser_->epilog(), total_width_)) {
for(auto& line : wrap_width(parser_->epilog(), total_width_, {" ", "/"})) {
ss << line;
}
ss << "\n";
Expand Down
2 changes: 1 addition & 1 deletion src/argparse_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace argparse {

char* strdup(const char* str);

std::vector<std::string> wrap_width(std::string str, size_t width, std::vector<std::string> split_str={" ", "/"});
std::vector<std::string> wrap_width(std::string str, size_t width, std::vector<std::string> split_str);

std::string basename(std::string filepath);
} //namespace
Expand Down