commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Fix #830 - Recognize Option, Value and Usage attributes on private members

Open Saalvage opened this issue 3 years ago • 1 comments

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 Usage functionality to the programming interface.

Additional arguments:

  • It's already possible to use private init/set on 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.

Saalvage avatar Jun 19 '22 16:06 Saalvage

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.

ericnewton76 avatar Sep 10 '22 17:09 ericnewton76