Skip to content

CommandSettings Branch Inheritance Not Displayed In Help #3

@brandonryan

Description

@brandonryan

When you have a config like:

appConf
    .AddBranch<MyBranchCliOptions>("mybranch", conf =>
    {
        conf.AddCommand<MyCommandCliOptions>("mycommand")
            .WithDescription("a command description")
    });

then you run dotnet run -- mybranch mycommand --help it only displays the help from MyCommandCliOptions excluding the inherited properties from MyBranchCliOptions.

public class MyBranchCliOptions: CommandSettings
{
    //properties here will not be shown in help
}

public class MyCommandCliOptions: MyBranchCliOptions
{
    //properties here will be shown in help
}

If you change

conf.AddCommand<MyCommandCliOptions>("mycommand")

to

conf.AddCommand("mycommand")

it works as expected but now my command settings for .AddCommand<> aren't enforced to inherit from the branch settings.

Additionally, when you ask --help at the branch level it shows properly. Probably an issue with reflection params when trying to get the attributes from the properties?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions