CLI11 2.7.2
C++11 Command Line Interface Parser
Loading...
Searching...
No Matches
StringTools_inl.hpp
1// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
2// under NSF AWARD 1414736 and by the respective contributors.
3// All rights reserved.
4//
5// SPDX-License-Identifier: BSD-3-Clause
6
7#pragma once
8
9// IWYU pragma: private, include "CLI/CLI.hpp"
10
11// This include is only needed for IDEs to discover symbols
12#include "../StringTools.hpp"
13
14// [CLI11:public_includes:set]
15#include <algorithm>
16#include <cctype>
17#include <cstddef>
18#include <cstdint>
19#include <cstdlib>
20#include <iomanip>
21#include <iterator>
22#include <locale>
23#include <sstream>
24#include <stdexcept>
25#include <string>
26#include <utility>
27#include <vector>
28// [CLI11:public_includes:end]
29
30namespace CLI {
31// [CLI11:string_tools_inl_hpp:verbatim]
32
33namespace detail {
34
35CLI11_INLINE bool isalpha(const std::string &str) {
36 return std::all_of(str.begin(), str.end(), [](char c) { return std::isalpha(c, std::locale()); });
37}
38
39CLI11_INLINE std::string to_lower(std::string str) {
40 std::transform(std::begin(str), std::end(str), std::begin(str), [](const std::string::value_type &x) {
41 return std::tolower(x, std::locale());
42 });
43 return str;
44}
45
46CLI11_INLINE std::vector<std::string> split(const std::string &s, char delim) {
47 std::vector<std::string> elems;
48 if(s.empty()) {
49 elems.emplace_back();
50 return elems;
51 }
52
53 std::size_t start = 0;
54 std::size_t end = 0;
55
56 while((end = s.find(delim, start)) != std::string::npos) {
57 elems.push_back(s.substr(start, end - start));
58 start = end + 1;
59 }
60 elems.push_back(s.substr(start));
61 return elems;
62}
63
64CLI11_INLINE std::string &ltrim(std::string &str) {
65 auto it = std::find_if(str.begin(), str.end(), [](char ch) { return !std::isspace<char>(ch, std::locale()); });
66 str.erase(str.begin(), it);
67 return str;
68}
69
70CLI11_INLINE std::string &ltrim(std::string &str, const std::string &filter) {
71 auto it = std::find_if(str.begin(), str.end(), [&filter](char ch) { return filter.find(ch) == std::string::npos; });
72 str.erase(str.begin(), it);
73 return str;
74}
75
76CLI11_INLINE std::string &rtrim(std::string &str) {
77 auto it = std::find_if(str.rbegin(), str.rend(), [](char ch) { return !std::isspace<char>(ch, std::locale()); });
78 str.erase(it.base(), str.end());
79 return str;
80}
81
82CLI11_INLINE std::string &rtrim(std::string &str, const std::string &filter) {
83 auto it =
84 std::find_if(str.rbegin(), str.rend(), [&filter](char ch) { return filter.find(ch) == std::string::npos; });
85 str.erase(it.base(), str.end());
86 return str;
87}
88
89CLI11_INLINE std::string &remove_quotes(std::string &str) {
90 if(!str.empty() && (str.front() == '"' || str.front() == '\'' || str.front() == '`')) {
91 remove_outer(str, str.front());
92 }
93 return str;
94}
95
96CLI11_INLINE std::string &remove_outer(std::string &str, char key) {
97 if(str.length() > 1 && (str.front() == key)) {
98 if(str.front() == str.back()) {
99 str.pop_back();
100 str.erase(str.begin(), str.begin() + 1);
101 }
102 }
103 return str;
104}
105
106CLI11_INLINE std::string fix_newlines(const std::string &leader, std::string input) {
107 std::string::size_type n = 0;
108 while(n != std::string::npos && n < input.size()) {
109 n = input.find_first_of("\r\n", n);
110 if(n != std::string::npos) {
111 if(input[n] == '\r' && n + 1 < input.size() && input[n + 1] == '\n') {
112 ++n;
113 }
114 input.insert(n + 1, leader);
115 n += leader.size() + 1;
116 }
117 }
118 return input;
119}
120
121CLI11_INLINE std::ostream &format_aliases(std::ostream &out, const std::vector<std::string> &aliases, std::size_t wid) {
122 if(!aliases.empty()) {
123 out << std::setw(static_cast<int>(wid)) << " aliases: ";
124 bool front = true;
125 for(const auto &alias : aliases) {
126 if(!front) {
127 out << ", ";
128 } else {
129 front = false;
130 }
131 out << detail::fix_newlines(" ", alias);
132 }
133 out << "\n";
134 }
135 return out;
136}
137
138CLI11_INLINE bool valid_name_string(const std::string &str) {
139 if(str.empty() || !valid_first_char(str[0])) {
140 return false;
141 }
142 auto e = str.end();
143 for(auto c = str.begin() + 1; c != e; ++c)
144 if(!valid_later_char(*c))
145 return false;
146 return true;
147}
148
149CLI11_INLINE std::string get_group_separators() {
150 std::string separators{"_'"};
151#if CLI11_HAS_RTTI != 0
152 char group_separator = std::use_facet<std::numpunct<char>>(std::locale()).thousands_sep();
153 separators.push_back(group_separator);
154#endif
155 return separators;
156}
157
158CLI11_INLINE std::string find_and_replace(std::string str, std::string from, std::string to) {
159
160 std::size_t start_pos = 0;
161
162 while((start_pos = str.find(from, start_pos)) != std::string::npos) {
163 str.replace(start_pos, from.length(), to);
164 start_pos += to.length();
165 }
166
167 return str;
168}
169
170CLI11_INLINE void remove_default_flag_values(std::string &flags) {
171 auto loc = flags.find_first_of('{', 2);
172 while(loc != std::string::npos) {
173 auto finish = flags.find_first_of("},", loc + 1);
174 if((finish != std::string::npos) && (flags[finish] == '}')) {
175 flags.erase(flags.begin() + static_cast<std::ptrdiff_t>(loc),
176 flags.begin() + static_cast<std::ptrdiff_t>(finish) + 1);
177 }
178 loc = flags.find_first_of('{', loc + 1);
179 }
180 flags.erase(std::remove(flags.begin(), flags.end(), '!'), flags.end());
181}
182
183CLI11_INLINE std::ptrdiff_t
184find_member(std::string name, const std::vector<std::string> &names, bool ignore_case, bool ignore_underscore) {
185 auto it = std::end(names);
186 if(ignore_case) {
187 if(ignore_underscore) {
188 name = detail::to_lower(detail::remove_underscore(name));
189 it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) {
190 return detail::to_lower(detail::remove_underscore(local_name)) == name;
191 });
192 } else {
193 name = detail::to_lower(name);
194 it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) {
195 return detail::to_lower(local_name) == name;
196 });
197 }
198
199 } else if(ignore_underscore) {
200 name = detail::remove_underscore(name);
201 it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) {
202 return detail::remove_underscore(local_name) == name;
203 });
204 } else {
205 it = std::find(std::begin(names), std::end(names), name);
206 }
207
208 return (it != std::end(names)) ? (it - std::begin(names)) : (-1);
209}
210
211CLI11_MODULE_INLINE const std::string &escapedChars() {
212 static const std::string s{"\b\t\n\f\r\"\\"};
213 return s;
214}
215CLI11_MODULE_INLINE const std::string &escapedCharsCode() {
216 static const std::string s{"btnfr\"\\"};
217 return s;
218}
219CLI11_MODULE_INLINE const std::string &bracketChars() {
220 static const std::string s{"\"'`[(<{"};
221 return s;
222}
223CLI11_MODULE_INLINE const std::string &matchBracketChars() {
224 static const std::string s{"\"'`])>}"};
225 return s;
226}
227
228CLI11_INLINE bool has_escapable_character(const std::string &str) {
229 return (str.find_first_of(escapedChars()) != std::string::npos);
230}
231
232CLI11_INLINE std::string add_escaped_characters(const std::string &str) {
233 std::string out;
234 out.reserve(str.size() + 4);
235 for(char s : str) {
236 auto sloc = escapedChars().find_first_of(s);
237 if(sloc != std::string::npos) {
238 out.push_back('\\');
239 out.push_back(escapedCharsCode()[sloc]);
240 } else {
241 out.push_back(s);
242 }
243 }
244 return out;
245}
246
247CLI11_INLINE std::uint32_t hexConvert(char hc) {
248 int hcode{0};
249 if(hc >= '0' && hc <= '9') {
250 hcode = (hc - '0');
251 } else if(hc >= 'A' && hc <= 'F') {
252 hcode = (hc - 'A' + 10);
253 } else if(hc >= 'a' && hc <= 'f') {
254 hcode = (hc - 'a' + 10);
255 } else {
256 hcode = -1;
257 }
258 return static_cast<uint32_t>(hcode);
259}
260
261CLI11_INLINE char make_char(std::uint32_t code) { return static_cast<char>(static_cast<unsigned char>(code)); }
262
263CLI11_INLINE void append_codepoint(std::string &str, std::uint32_t code) {
264 if(code < 0x80) { // ascii code equivalent
265 str.push_back(static_cast<char>(code));
266 } else if(code < 0x800) { // \u0080 to \u07FF
267 // 110yyyyx 10xxxxxx; 0x3f == 0b0011'1111
268 str.push_back(make_char(0xC0 | code >> 6));
269 str.push_back(make_char(0x80 | (code & 0x3F)));
270 } else if(code < 0x10000) { // U+0800...U+FFFF
271 if(0xD800 <= code && code <= 0xDFFF) {
272 throw std::invalid_argument("[0xD800, 0xDFFF] are not valid code points.");
273 }
274 // 1110yyyy 10yxxxxx 10xxxxxx
275 str.push_back(make_char(0xE0 | code >> 12));
276 str.push_back(make_char(0x80 | (code >> 6 & 0x3F)));
277 str.push_back(make_char(0x80 | (code & 0x3F)));
278 } else if(code < 0x110000) { // U+010000 ... U+10FFFF
279 // 11110yyy 10yyxxxx 10xxxxxx 10xxxxxx
280 str.push_back(make_char(0xF0 | code >> 18));
281 str.push_back(make_char(0x80 | (code >> 12 & 0x3F)));
282 str.push_back(make_char(0x80 | (code >> 6 & 0x3F)));
283 str.push_back(make_char(0x80 | (code & 0x3F)));
284 } else { // code points above U+10FFFF are not valid
285 throw std::invalid_argument("values above 0x10FFFF are not valid code points.");
286 }
287}
288
289CLI11_INLINE std::string remove_escaped_characters(const std::string &str) {
290
291 std::string out;
292 out.reserve(str.size());
293 for(auto loc = str.begin(); loc < str.end(); ++loc) {
294 if(*loc == '\\') {
295 if(str.end() - loc < 2) {
296 throw std::invalid_argument("invalid escape sequence " + str);
297 }
298 auto ecloc = escapedCharsCode().find_first_of(*(loc + 1));
299 if(ecloc != std::string::npos) {
300 out.push_back(escapedChars()[ecloc]);
301 ++loc;
302 } else if(*(loc + 1) == 'u') {
303 // must have 4 hex characters
304 if(str.end() - loc < 6) {
305 throw std::invalid_argument("unicode sequence must have 4 hex codes " + str);
306 }
307 std::uint32_t code{0};
308 std::uint32_t mplier{16 * 16 * 16};
309 for(int ii = 2; ii < 6; ++ii) {
310 std::uint32_t res = hexConvert(*(loc + ii));
311 if(res > 0x0F) {
312 throw std::invalid_argument("unicode sequence must have 4 hex codes " + str);
313 }
314 code += res * mplier;
315 mplier = mplier / 16;
316 }
317 append_codepoint(out, code);
318 loc += 5;
319 } else if(*(loc + 1) == 'U') {
320 // must have 8 hex characters
321 if(str.end() - loc < 10) {
322 throw std::invalid_argument("unicode sequence must have 8 hex codes " + str);
323 }
324 std::uint32_t code{0};
325 std::uint32_t mplier{16 * 16 * 16 * 16 * 16 * 16 * 16};
326 for(int ii = 2; ii < 10; ++ii) {
327 std::uint32_t res = hexConvert(*(loc + ii));
328 if(res > 0x0F) {
329 throw std::invalid_argument("unicode sequence must have 8 hex codes " + str);
330 }
331 code += res * mplier;
332 mplier = mplier / 16;
333 }
334 append_codepoint(out, code);
335 loc += 9;
336 } else if(*(loc + 1) == '0') {
337 out.push_back('\0');
338 ++loc;
339 } else {
340 throw std::invalid_argument(std::string("unrecognized escape sequence \\") + *(loc + 1) + " in " + str);
341 }
342 } else {
343 out.push_back(*loc);
344 }
345 }
346 return out;
347}
348
349CLI11_INLINE std::size_t close_string_quote(const std::string &str, std::size_t start, char closure_char) {
350 std::size_t loc{0};
351 for(loc = start + 1; loc < str.size(); ++loc) {
352 if(str[loc] == closure_char) {
353 break;
354 }
355 if(str[loc] == '\\') {
356 // skip the next character for escaped sequences
357 ++loc;
358 }
359 }
360 return loc;
361}
362
363CLI11_INLINE std::size_t close_literal_quote(const std::string &str, std::size_t start, char closure_char) {
364 auto loc = str.find_first_of(closure_char, start + 1);
365 return (loc != std::string::npos ? loc : str.size());
366}
367
368CLI11_INLINE std::size_t close_sequence(const std::string &str, std::size_t start, char closure_char) {
369
370 auto bracket_loc = matchBracketChars().find(closure_char);
371 switch(bracket_loc) {
372 case 0:
373 return close_string_quote(str, start, closure_char);
374 case 1:
375 case 2:
376#if defined(_MSC_VER) && _MSC_VER < 1920
377 case(std::size_t)-1:
378#else
379 case std::string::npos:
380#endif
381 return close_literal_quote(str, start, closure_char);
382 default:
383 break;
384 }
385
386 std::string closures(1, closure_char);
387 auto loc = start + 1;
388
389 while(loc < str.size()) {
390 if(str[loc] == closures.back()) {
391 closures.pop_back();
392 if(closures.empty()) {
393 return loc;
394 }
395 }
396 bracket_loc = bracketChars().find(str[loc]);
397 if(bracket_loc != std::string::npos) {
398 switch(bracket_loc) {
399 case 0:
400 loc = close_string_quote(str, loc, str[loc]);
401 break;
402 case 1:
403 case 2:
404 loc = close_literal_quote(str, loc, str[loc]);
405 break;
406 default:
407 closures.push_back(matchBracketChars()[bracket_loc]);
408 break;
409 }
410 }
411 ++loc;
412 }
413 if(loc > str.size()) {
414 loc = str.size();
415 }
416 return loc;
417}
418
419CLI11_INLINE std::vector<std::string> split_up(std::string str, char delimiter) {
420
421 auto find_ws = [delimiter](char ch) {
422 return (delimiter == '\0') ? std::isspace<char>(ch, std::locale()) : (ch == delimiter);
423 };
424 trim(str);
425
426 std::vector<std::string> output;
427 while(!str.empty()) {
428 if(bracketChars().find_first_of(str[0]) != std::string::npos) {
429 auto bracketLoc = bracketChars().find_first_of(str[0]);
430 auto end = close_sequence(str, 0, matchBracketChars()[bracketLoc]);
431 if(end >= str.size()) {
432 output.push_back(std::move(str));
433 str.clear();
434 } else {
435 output.push_back(str.substr(0, end + 1));
436 // The character following a closing quote/bracket is normally a delimiter and is
437 // consumed. If it is an ordinary character it must be retained (resume from it) so
438 // no characters are silently lost (e.g. `"abc"def` -> {"abc", "def"}). However if it
439 // is itself a quote/bracket opening character, resuming from it would start a fresh
440 // (potentially unterminated) quoted sequence that could swallow later delimiters, so
441 // it is skipped like the original delimiter case to keep splitting well behaved.
442 char follow = str[end + 1];
443 bool skip_follow = find_ws(follow) || (bracketChars().find_first_of(follow) != std::string::npos);
444 auto next = skip_follow ? end + 2 : end + 1;
445 if(next < str.size()) {
446 str = str.substr(next);
447 } else {
448 str.clear();
449 }
450 }
451
452 } else {
453 auto it = std::find_if(std::begin(str), std::end(str), find_ws);
454 if(it != std::end(str)) {
455 std::string value = std::string(str.begin(), it);
456 output.push_back(value);
457 str = std::string(it + 1, str.end());
458 } else {
459 output.push_back(str);
460 str.clear();
461 }
462 }
463 trim(str);
464 }
465 return output;
466}
467
468CLI11_INLINE std::size_t escape_detect(std::string &str, std::size_t offset) {
469 auto next = str[offset + 1];
470 if((next == '\"') || (next == '\'') || (next == '`')) {
471 if(offset == 0) {
472 // nothing precedes the trigger character, so there is nothing to reinterpret
473 return offset + 1;
474 }
475 auto astart = str.find_last_of("-/ \"\'`", offset - 1);
476 if(astart != std::string::npos) {
477 if(str[astart] == ((str[offset] == '=') ? '-' : '/'))
478 str[offset] = ' '; // interpret this as a space so the split_up works properly
479 }
480 }
481 return offset + 1;
482}
483
484CLI11_INLINE std::string binary_escape_string(const std::string &string_to_escape, bool force) {
485 // s is our escaped output string
486 std::string escaped_string{};
487 // loop through all characters
488 for(char c : string_to_escape) {
489 // check if a given character is printable
490 // the cast is necessary to avoid undefined behaviour
491 if(isprint(static_cast<unsigned char>(c)) == 0) {
492 std::stringstream stream;
493 // if the character is not printable
494 // we'll convert it to a hex string using a stringstream
495 // note that since char is signed we have to cast it to unsigned first
496 stream << std::hex << static_cast<unsigned int>(static_cast<unsigned char>(c));
497 std::string code = stream.str();
498 escaped_string += std::string("\\x") + (code.size() < 2 ? "0" : "") + code;
499 } else if(c == 'x' || c == 'X') {
500 // need to check for inadvertent binary sequences
501 if(!escaped_string.empty() && escaped_string.back() == '\\') {
502 escaped_string += std::string("\\x") + (c == 'x' ? "78" : "58");
503 } else {
504 escaped_string.push_back(c);
505 }
506
507 } else {
508 escaped_string.push_back(c);
509 }
510 }
511 if(escaped_string != string_to_escape || force) {
512 auto sqLoc = escaped_string.find('\'');
513 while(sqLoc != std::string::npos) {
514 escaped_string[sqLoc] = '\\';
515 escaped_string.insert(sqLoc + 1, "x27");
516 sqLoc = escaped_string.find('\'', sqLoc + 4);
517 }
518 escaped_string.insert(0, "'B\"(");
519 escaped_string.push_back(')');
520 escaped_string.push_back('"');
521 escaped_string.push_back('\'');
522 }
523 return escaped_string;
524}
525
526CLI11_INLINE bool is_binary_escaped_string(const std::string &escaped_string) {
527 size_t ssize = escaped_string.size();
528 if(escaped_string.compare(0, 3, "B\"(") == 0 && escaped_string.compare(ssize - 2, 2, ")\"") == 0) {
529 return true;
530 }
531 return (escaped_string.compare(0, 4, "'B\"(") == 0 && escaped_string.compare(ssize - 3, 3, ")\"'") == 0);
532}
533
534CLI11_INLINE std::string extract_binary_string(const std::string &escaped_string) {
535 std::size_t start{0};
536 std::size_t tail{0};
537 size_t ssize = escaped_string.size();
538 if(escaped_string.compare(0, 3, "B\"(") == 0 && escaped_string.compare(ssize - 2, 2, ")\"") == 0) {
539 start = 3;
540 tail = 2;
541 } else if(escaped_string.compare(0, 4, "'B\"(") == 0 && escaped_string.compare(ssize - 3, 3, ")\"'") == 0) {
542 start = 4;
543 tail = 3;
544 }
545
546 if(start == 0) {
547 return escaped_string;
548 }
549 std::string outstring;
550
551 outstring.reserve(ssize - start - tail);
552 std::size_t loc = start;
553 while(loc < ssize - tail) {
554 // ssize-2 to skip )" at the end
555 if(escaped_string[loc] == '\\' && (escaped_string[loc + 1] == 'x' || escaped_string[loc + 1] == 'X')) {
556 auto c1 = escaped_string[loc + 2];
557 auto c2 = escaped_string[loc + 3];
558
559 std::uint32_t res1 = hexConvert(c1);
560 std::uint32_t res2 = hexConvert(c2);
561 if(res1 <= 0x0F && res2 <= 0x0F) {
562 loc += 4;
563 outstring.push_back(static_cast<char>(res1 * 16 + res2));
564 continue;
565 }
566 }
567 outstring.push_back(escaped_string[loc]);
568 ++loc;
569 }
570 return outstring;
571}
572
573CLI11_INLINE void remove_quotes(std::vector<std::string> &args) {
574 for(auto &arg : args) {
575 if(arg.empty()) {
576 continue;
577 }
578 if(arg.front() == '\"' && arg.back() == '\"') {
579 remove_quotes(arg);
580 // only remove escaped for string arguments not literal strings
581 arg = remove_escaped_characters(arg);
582 } else {
583 remove_quotes(arg);
584 }
585 }
586}
587
588CLI11_INLINE void handle_secondary_array(std::string &str) {
589 if(str.size() >= 2 && str.front() == '[' && str.back() == ']') {
590 // handle some special array processing for arguments if it might be interpreted as a secondary array
591 std::string tstr{"[["};
592 for(std::size_t ii = 1; ii < str.size(); ++ii) {
593 tstr.push_back(str[ii]);
594 tstr.push_back(str[ii]);
595 }
596 str = std::move(tstr);
597 }
598}
599
600CLI11_INLINE bool
601process_quoted_string(std::string &str, char string_char, char literal_char, bool disable_secondary_array_processing) {
602 if(str.size() <= 1) {
603 return false;
604 }
605 if(detail::is_binary_escaped_string(str)) {
606 str = detail::extract_binary_string(str);
607 if(!disable_secondary_array_processing)
608 handle_secondary_array(str);
609 return true;
610 }
611 if(str.front() == string_char && str.back() == string_char) {
612 detail::remove_outer(str, string_char);
613 if(str.find_first_of('\\') != std::string::npos) {
614 str = detail::remove_escaped_characters(str);
615 }
616 if(!disable_secondary_array_processing)
617 handle_secondary_array(str);
618 return true;
619 }
620 if((str.front() == literal_char || str.front() == '`') && str.back() == str.front()) {
621 detail::remove_outer(str, str.front());
622 if(!disable_secondary_array_processing)
623 handle_secondary_array(str);
624 return true;
625 }
626 return false;
627}
628
629CLI11_INLINE std::string get_environment_value(const std::string &env_name) {
630 std::string ename_string;
631
632#ifdef _MSC_VER
633 // Windows version
634 char *buffer = nullptr;
635 std::size_t sz = 0;
636 if(_dupenv_s(&buffer, &sz, env_name.c_str()) == 0 && buffer != nullptr) {
637 ename_string = std::string(buffer);
638 free(buffer);
639 }
640#else
641 // This also works on Windows, but gives a warning
642
643 // MISRA static analysis need. MISRACPP2023-25_5_2-a-1
644 const char *buffer = nullptr;
645 buffer = std::getenv(env_name.c_str());
646 if(buffer != nullptr) {
647 ename_string = std::string(buffer);
648 }
649#endif
650 return ename_string;
651}
652
653CLI11_INLINE std::ostream &streamOutAsParagraph(std::ostream &out,
654 const std::string &text,
655 std::size_t paragraphWidth,
656 const std::string &linePrefix,
657 bool skipPrefixOnFirstLine) {
658 std::istringstream lss(text);
659 std::string line = "";
660 while(std::getline(lss, line)) {
661 std::istringstream iss(line);
662 std::string word = "";
663 std::size_t charsWritten = 0;
664
665 if(!skipPrefixOnFirstLine)
666 out << linePrefix;
667 skipPrefixOnFirstLine = false; // subsequent lines always get the prefix
668
669 while(iss >> word) {
670 if(charsWritten > 0 && (word.length() + 1 + charsWritten > paragraphWidth)) {
671 out << '\n' << linePrefix;
672 charsWritten = 0;
673 }
674 if(charsWritten == 0) {
675 out << word;
676 charsWritten += word.length();
677 } else {
678 out << ' ' << word;
679 charsWritten += word.length() + 1;
680 }
681 }
682
683 if(!lss.eof())
684 out << '\n';
685 }
686 return out;
687}
688
689} // namespace detail
690// [CLI11:string_tools_inl_hpp:end]
691} // namespace CLI