cmdopt2/parser: render argument placeholders during usage
This commit is contained in:
parent
f64d617156
commit
8a38459f9a
@ -211,15 +211,24 @@ usage (
|
|||||||
for (auto const &arg: keyword) {
|
for (auto const &arg: keyword) {
|
||||||
auto const &delimiters = arg.required ? REQUIRED : OPTIONAL;
|
auto const &delimiters = arg.required ? REQUIRED : OPTIONAL;
|
||||||
|
|
||||||
if (arg.short_)
|
if (arg.short_) {
|
||||||
fmt::print (output, " {}-{}{}", delimiters[0], '-', *arg.short_, delimiters[1]);
|
fmt::print (output, FMT_STRING (" {}-{}"), delimiters[0], *arg.short_);
|
||||||
if (arg.long_)
|
if (arg.acceptor1)
|
||||||
fmt::print (output, " {}--{}{}", delimiters[0], "--", *arg.long_, delimiters[1]);
|
fmt::print (output, FMT_STRING (" <{}>"), arg.name);
|
||||||
|
fmt::print (output, FMT_STRING ("{}"), delimiters[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arg.long_) {
|
||||||
|
fmt::print (output, FMT_STRING (" {}--{}"), delimiters[0], *arg.long_);
|
||||||
|
if (arg.acceptor1)
|
||||||
|
fmt::print (output, FMT_STRING (" <{}>"), arg.name);
|
||||||
|
fmt::print (output, FMT_STRING ("{}"), delimiters[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto const &arg: positional) {
|
for (auto const &arg: positional) {
|
||||||
auto const &delimiters = arg.required ? REQUIRED : OPTIONAL;
|
auto const &delimiters = arg.required ? REQUIRED : OPTIONAL;
|
||||||
fmt::print (output, " {}{}{}", delimiters[0], arg.name, delimiters[1]);
|
fmt::print (output, FMT_STRING (" {}{}{}"), delimiters[0], arg.name, delimiters[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt::print (output, "\n");
|
fmt::print (output, "\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user