Tyrrrz / CliFx

Class-first framework for building command-line interfaces
MIT License
1.5k stars 61 forks source link

Add multiple inheritance support through interfaces #120

Closed alirezanet closed 2 years ago

alirezanet commented 2 years ago

This PR unluck multiple inheritance using interfaces (c# 8 feature) for CommandParameter and CommandOption. why? I was looking for a solution to define a few global options, In #58 You had a suggestion about using interfaces for multiple inheritance! that was an amazing suggestion 😲 but unfortunately, clifx did not support that 😟. This PR solves that issue.

Note(optional): If you have LinqPad check out the attached file, this is a simple real-world example.

Related to #58 MultipleInheritance.zip

Tyrrrz commented 2 years ago

Thanks for the PR! Can you also please add a simple test for this? Could just put them into OptionBindingSpecs I think. Have a simple command that inherits option properties from two interfaces and make sure they are bound correctly.

alirezanet commented 2 years ago

Done.