Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17416

Support for bare double dash in argument parsing with SimpleCommandLineArgsParser


    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Waiting for Triage
    • Component/s: Core
    • Labels:


      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)




            • Assignee:
              juergen.hoeller Juergen Hoeller
              pwebb Phil Webb
              Last updater:
              Spring Issuemaster
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created:
                Days since last comment:
                47 weeks, 2 days ago