Skip to content

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

Open
Saalvage wants to merge 2 commits into
commandlineparser:masterfrom
Saalvage:issue830
Open

Saalvage wants to merge 2 commits into
commandlineparser:masterfrom
Saalvage:issue830

Conversation

@Saalvage

Copy link
Copy Markdown

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

ericnewton76 commented Sep 10, 2022 •

Copy link
Copy Markdown
Member

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

2 participants