commandline
commandline copied to clipboard
Fix #830 - Recognize Option, Value and Usage attributes on private members
Potential use cases:
- Requiring additional parsing which requires type or multiplicity changes and wanting to avoid exposing those
init/set-only properties unnecessarily, as usage of the Options class from a programming interface should not rely on the parsing and instead assign the parsed properties directly. - The ability to encapsulate functionality in the Options class without having to expose the properties directly.
- Not wanting to expose the
Usagefunctionality to the programming interface.
Additional arguments:
- It's already possible to use private
init/seton a public property, so this seems more like an oversight (or the other way around!) - I don't think there are any good reasons to uphold this restriction.
The point of the Options class was only to hold the parser results. Its a single-use design, that implies you have the ability to make public all options so the parser can apply parsed items from the commandline.
I'm a little dubious on making the change but since it doesnt actually hurt anything it'll probably go through
And BTW, thank you for also submitting the tests.