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 .strictOptionalOptionArguments() for POSIX-style handling of options with optional option-arguments #1951

Closed

Conversation

aweebit
Copy link
Contributor

@aweebit aweebit commented Aug 8, 2023

Fixes #1901.

ChangeLog

Added

  • .strictOptionalOptionArguments() for POSIX-style handling of options with optional option-arguments

Eliminates redundant calls and checks.

(cherry picked from commit dd2c9c8)
- Check if new option is usable with current settings before registering
- Check if registered options remain usable when updating settings

_registerOption() has been borrowed from deb3bdf in tj#1923.
lib/option.js Fixed Show fixed Hide fixed
@shadowspawn
Copy link
Collaborator

This is something I have been thinking about for years. I will be interested to see how you have approached it, but may choose to do it myself.

@aweebit aweebit force-pushed the feature/strictOptionalOptionArguments branch from baaae81 to 7577e65 Compare August 8, 2023 15:59
@aweebit
Copy link
Contributor Author

aweebit commented Aug 8, 2023

(Force pushed to undo the merge with #1950.)

@shadowspawn
Copy link
Collaborator

Leaving #1901 open to see if there is any interest or compelling use cases.

There are some extra commits in this PR, the relevant commits to the strict optionals are:

See also a different approach in #1984 where the help shows the flags as supplied by author and up to author to format appropriately.

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.

2 participants