Describe the bug
When I override a branch setting using
public override ValidationResult Validate()
[EDIT] the base Validate() method is never called.
Here is a full example (taken from the docs) :
public class AddSettings : CommandSettings
{
[CommandArgument(0, "[PROJECT]")]
public string Project { get; set; }
// This is never called
public override ValidationResult Validate() => ValidationResult.Success();
}
public class AddPackageSettings : AddSettings
{
[CommandArgument(0, "<PACKAGE_NAME>")]
public string PackageName { get; set; }
[CommandOption("-v|--version <VERSION>")]
public string Version { get; set; }
// This one is called
public override ValidationResult Validate() => ValidationResult.Success();
}
public class AddReferenceSettings : AddSettings
{
[CommandArgument(0, "<PROJECT_REFERENCE>")]
public string ProjectReference { get; set; }
// This one is called
public override ValidationResult Validate() => ValidationResult.Success();
}
The problem is that I don't want to call base.Validate() for every child command as it complicates future additions to the project: every new setting would have to remember to call base.Validate().
I don't know if this is because it's declared as a branch or because it has child settings.
Describe the bug
When I override a branch setting using
[EDIT] the base
Validate()method is never called.Here is a full example (taken from the docs) :
The problem is that I don't want to call
base.Validate()for every child command as it complicates future additions to the project: every new setting would have to remember to callbase.Validate().I don't know if this is because it's declared as a branch or because it has child settings.