Commit c25bbc29 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

lib/CLI11.hpp: bikeshed output, -h/-H

parent 58d452d7
...@@ -225,7 +225,7 @@ inline std::vector<std::string> split(const std::string &s, char delim) { ...@@ -225,7 +225,7 @@ inline std::vector<std::string> split(const std::string &s, char delim) {
} }
/// Simple function to join a string /// Simple function to join a string
template <typename T> std::string join(const T &v, std::string delim = ",") { template <typename T> std::string join(const T &v, std::string delim = ", ") {
std::ostringstream s; std::ostringstream s;
size_t start = 0; size_t start = 0;
for(const auto &i : v) { for(const auto &i : v) {
...@@ -237,7 +237,7 @@ template <typename T> std::string join(const T &v, std::string delim = ",") { ...@@ -237,7 +237,7 @@ template <typename T> std::string join(const T &v, std::string delim = ",") {
} }
/// Join a string in reverse order /// Join a string in reverse order
template <typename T> std::string rjoin(const T &v, std::string delim = ",") { template <typename T> std::string rjoin(const T &v, std::string delim = ", ") {
std::ostringstream s; std::ostringstream s;
for(size_t start = 0; start < v.size(); start++) { for(size_t start = 0; start < v.size(); start++) {
if(start > 0) if(start > 0)
...@@ -1583,8 +1583,8 @@ class Option : public OptionBase<Option> { ...@@ -1583,8 +1583,8 @@ class Option : public OptionBase<Option> {
out << " x " << get_expected(); out << " x " << get_expected();
if(get_expected() == -1) if(get_expected() == -1)
out << " ..."; out << " ...";
if(get_required()) // if(get_required())
out << " (REQUIRED)"; // out << " (REQUIRED)";
} }
if(!envname_.empty()) if(!envname_.empty())
out << " (env:" << envname_ << ")"; out << " (env:" << envname_ << ")";
...@@ -2689,7 +2689,7 @@ class App { ...@@ -2689,7 +2689,7 @@ class App {
// Positional descriptions // Positional descriptions
if(pos) { if(pos) {
out << std::endl << "Positionals:" << std::endl; out << std::endl ;
for(const Option_p &opt : options_) { for(const Option_p &opt : options_) {
if(detail::to_lower(opt->get_group()).empty()) if(detail::to_lower(opt->get_group()).empty())
continue; // Hidden continue; // Hidden
...@@ -2703,7 +2703,7 @@ class App { ...@@ -2703,7 +2703,7 @@ class App {
for(const std::string &group : groups) { for(const std::string &group : groups) {
if(detail::to_lower(group).empty()) if(detail::to_lower(group).empty())
continue; // Hidden continue; // Hidden
out << std::endl << group << ":" << std::endl; out << std::endl << group << std::endl;
for(const Option_p &opt : options_) { for(const Option_p &opt : options_) {
if(opt->nonpositional() && opt->get_group() == group && opt->help_level_ <= help_level) if(opt->nonpositional() && opt->get_group() == group && opt->help_level_ <= help_level)
detail::format_help(out, opt->help_name(true), opt->get_description(), wid); detail::format_help(out, opt->help_name(true), opt->get_description(), wid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment