Skip to content

Conversation

@DannyBen
Copy link
Member

@DannyBen DannyBen commented Oct 28, 2021

The previous implementation of required_args_filter and required_flags_filter was unnecessarily complex.

Before

The filters were put in front of everything else, and participated in collecting ARGV. Once they did not find what they wanted, they aborted. This also added a side effect that forced to implement some logical points in more than one places: The required, and optional.

After

Arguments and flags are collected by the normal loop, and the filters are placed at the end of the loop just to ensure that the $args array is filled with all the things that are required.

Closes #124

@DannyBen DannyBen merged commit 7417c24 into master Oct 28, 2021
@DannyBen DannyBen deleted the fix/required-arg-filter branch October 28, 2021 05:58
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 flags to precede required positional arguments

2 participants