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

Add Command.options to TypeScript #1827

Merged

Conversation

shadowspawn
Copy link
Collaborator

Pull Request

Problem

People want to access options on the command object from TypeScript. See: #1784 #1825

But we don't want people to muck with the options array...

I have been suggesting Help.visibleOptions(), but it is really only a good match for cases where client wants the automatic options included or the hidden options removed. It is a bit indirect as a general access method.

Solution

Add options.

Make both options and commands readonly to discourage direct modification, as suggested in #1184 by @vonagam and in #1784 by @mshima.

All three authors of previous related PR added as co-authors on this PR. Thanks for your past contributions!

ChangeLog

  • added: TypeScript: options property of Command
  • changed: TypeScript: commands property of Command is now readonly

Make options and commands readonly to discourage direct manipulation.

Co-authored-by: Cynthia <cynthia@cynthia.dev>
Co-authored-by: Marcelo Shima <marceloshima@gmail.com>
Co-authored-by: Dmitry Maganov <vonagam@gmail.com>
@shadowspawn shadowspawn added the semver: major Releasing requires a major version bump, not backwards compatible label Nov 29, 2022
Copy link
Collaborator

@abetomo abetomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: major Releasing requires a major version bump, not backwards compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants