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

Extend Option with argRequired and argOptional #1558

Closed

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented Jul 3, 2021

Pull Request

Fill out the Option methods to allow explicit configuration as alternative to implicit syntax from string.

This is not likely to be used much, and some downsides to having two ways to do something! Trying out an idea.

Method naming is intended to work with Argument too.

Problem

The syntax for required (<arg>) and optional ([arg]) option-arguments needs to be learned. (However, this is consistent with the syntax shown in the help so is useful to learn!)

Related: #665 #1359 (comment)

Solution

Add .argRequired() and .argOptional() to Option.

Adding for completeness, and not planning to add this to README for now.

ChangeLog

  • add Option methods for .argRequired() and .argOptional() as alternative way of specifying option-argument

@shadowspawn
Copy link
Collaborator Author

Happy with this as a proof of concept, but not sure it is worthwhile unless some demand.

Going to try similar pattern for Argument, where it should be simpler. (e.g. keep argument name separate)

Closing this for now.

@shadowspawn shadowspawn closed this Jul 5, 2021
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.

None yet

1 participant