Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Saalvage
Copy link

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 Saalvage changed the base branch from develop to master June 19, 2022 16:25
@ericnewton76
Copy link
Member

ericnewton76 commented Sep 10, 2022

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 ericnewton76 self-assigned this Sep 10, 2022
@ericnewton76 ericnewton76 added this to the 2.9.2 milestone Sep 10, 2022
@ericnewton76 ericnewton76 linked an issue Sep 10, 2022 that may be closed by this pull request
@ericnewton76 ericnewton76 removed their assignment Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow private property options
2 participants