clipp
clipp copied to clipboard
documentation formatting wrong for groups with only value options
Code:
auto cli = (option("--a") & value("A") % "help a", option("-b") & value("B") % "help b") % "group 1";
std::cout << make_man_page(cli, "test");
Expected:
SYNOPSIS
test [--a <A>] [-b <B>]
OPTIONS
group 1
<A> help a
<B> help b
Actual:
SYNOPSIS
test [--a <A>] [-b <B>]
OPTIONS
[--a <A>] [-b <B>]
group 1
This works fine:
auto cli = (option("--a") & value("A") % "help a", option("-b") % "help b") % "group 1";
std::cout << make_man_page(cli, "test");
SYNOPSIS
test [--a <A>] [-b]
OPTIONS
group 1
<A> help a
-b help b
live example: https://wandbox.org/permlink/m9OeLGfP7ZDiOjD1
Looks like this workaround produces the expected output:
auto cli = (option("--a") & value("A") % "help a", option("-b") & value("B") % "help b", option("") % "dummy") % "group 1";
Edit: except for some maybe unwanted newlines.