Skip to content

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

Closed
bclozel wants to merge 1 commit into
spring-projects:mainfrom
bclozel:gh-21949
Closed

Support "--" end of options in SimpleCommandLineArgsParser#31513
bclozel wants to merge 1 commit into
spring-projects:mainfrom
bclozel:gh-21949

Conversation

@bclozel

@bclozel bclozel commented Oct 27, 2023

Copy link
Copy Markdown
Member

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

bclozel commented Nov 6, 2023

Copy link
Copy Markdown
Member Author

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