Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation formatting wrong for groups with only value options #58

Open
NikolausDemmel opened this issue Oct 8, 2020 · 1 comment

Comments

@NikolausDemmel
Copy link

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

@NikolausDemmel
Copy link
Author

NikolausDemmel commented Oct 8, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant