Skip to content

Support for bare double dash in argument parsing of SpringApplication #14909

Closed
@mprimi

Description

@mprimi

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions