Skip to content

Subcommand usage help incorrectly uses singular label when max=0 (unlimited), should use plural #1168

@bryarrow

Description

@bryarrow

When generating usage/help text for subcommands, CLI11 currently uses a logic similar to:

out << get_lable(app->get_require_subcommand_max() < 2 || app->get_require_subcommand_min() > 1
           ? "SUBCOMMAND"
           : "SUBCOMMANDS");

However, according to the code in class App, max=0 means "unlimited", i.e., any number of subcommands are allowed. In this case, the logic above will use the singular label ("SUBCOMMAND"), which is incorrect in English (and also causes issues for i18n).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions