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 for bare double dash in argument parsing with SimpleCommandLineArgsParser [SPR-17416] #21949

Open
spring-issuemaster opened this issue Oct 20, 2018 · 0 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Oct 20, 2018

Phil Webb opened SPR-17416 and commented

Originally raise as a Spring Boot issue:

I would like Spring Boot application to support guideline 10 of POSIX.1-2017 - Utility argument convention section:

| 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.

The desired behavior is to recognize the -- and leave all the arguments to the right of it alone.

Just for context: in 2.0.x passing -- to a SpringBoot application results in an error (sample trace below). The double dash is treated as an invalid option (whose name is zero-length) and there seems to be no way to configure this behavior.

java.lang.IllegalArgumentException: Invalid argument syntax: --
	at org.springframework.core.env.SimpleCommandLineArgsParser.parse(SimpleCommandLineArgsParser.java:75)
	at org.springframework.core.env.SimpleCommandLinePropertySource.<init>(SimpleCommandLinePropertySource.java:90)
	at org.springframework.boot.DefaultApplicationArguments$Source.<init>(DefaultApplicationArguments.java:76)
	at org.springframework.boot.DefaultApplicationArguments.<init>(DefaultApplicationArguments.java:42)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
	at com.netflix.genie.GenieAgentApplication.run(GenieAgentApplication.java:63)

Reference URL: spring-projects/spring-boot#14909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.