Skip to content

Private members in base classes are ignored #287

@Alxandr

Description

@Alxandr

Describe the bug
If you have nested classes as following:

abstract class BaseCommand {
  [Option("--foo")]
  string Foo { get; }
}

[Command("test")]
class TestCommand : BaseCommand {
}

the --foo option is not configured.
The issue here is that https://github.com/natemcmaster/CommandLineUtils/blob/988c426/src/CommandLineUtils/Internal/ReflectionHelper.cs#L50 does not return private properties of base classes.

Expected behavior
I would expect the the --foo option to be available.

Additional context
Version of McMaster.Extensions.Hosting.CommandLine: 2.4.2

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions