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

Support "--" end of options in SimpleCommandLineArgsParser #31513

Closed
wants to merge 1 commit into from

Conversation

bclozel
Copy link
Member

@bclozel bclozel commented Oct 27, 2023

Prior to this commit, the SimpleCommandLineArgsParser would reject
"--" arguments as invalid. As reported by the community, the POSIX
utility conventions (Guideline 10) state that

The first -- argument that is not an option-argument should be
accepted as a delimiter indicating the end of options.
Any following arguments should be treated as operands, even if they
begin with the '-' character.

This commit updates SimpleCommandLineArgsParser to not reject "--"
arguments and instead to consider remaining arguments as non-optional.

Fixes gh-21949

@bclozel bclozel added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Oct 27, 2023
@bclozel bclozel self-assigned this Oct 27, 2023
@bclozel bclozel added this to the 6.2.x milestone Oct 27, 2023
Prior to this commit, the `SimpleCommandLineArgsParser` would reject
"--" arguments as invalid. As reported by the community, the POSIX
utility conventions (Guideline 10) state that

> The first -- argument that is not an option-argument should be
> accepted as a delimiter indicating the end of options.
> Any following arguments should be treated as operands, even if they
> begin with the '-' character.

This commit updates `SimpleCommandLineArgsParser` to not reject "--"
arguments and instead to consider remaining arguments as non-optional.

Fixes spring-projectsgh-21949
@bclozel
Copy link
Member Author

bclozel commented Nov 6, 2023

Thanks @reevik , I've updated my PR.

@snicoll snicoll modified the milestones: 6.2.x, 6.2.0-M1 Jan 15, 2024
snicoll pushed a commit that referenced this pull request Feb 15, 2024
Prior to this commit, the `SimpleCommandLineArgsParser` would reject
"--" arguments as invalid. As reported by the community, the POSIX
utility conventions (Guideline 10) state that

> The first -- argument that is not an option-argument should be
> accepted as a delimiter indicating the end of options.
> Any following arguments should be treated as operands, even if they
> begin with the '-' character.

This commit updates `SimpleCommandLineArgsParser` to not reject "--"
arguments and instead to consider remaining arguments as non-optional.

See gh-31513
@snicoll snicoll closed this in 0fbfecd Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for bare double dash in argument parsing with SimpleCommandLineArgsParser [SPR-17416]
3 participants