Skip to content

Parser bug: first argument following clustered options is treated as a positional parameter #233

@mgrossmann

Description

@mgrossmann

I use two boolean options. e.g. -c (compress) -e (encrypt) and one string option e.g. -o (outputFile) .
The i use parameter "1..*" FILE for inputFileNames(String[]).

Usage:
cmd -c -e -o OUTPUTFILE INPUTFILE1 INPUTFILE2 INPUTFILE3 -> work
cmd -ceo OUTPUTFILE INPUTFILE1 INPUTFILE2 INPUTFILE3 -> work
cmd -ce -o OUTPUTFILE INPUTFILE1 INPUTFILE2 INPUTFILE -> failed
will be parsed to:
outputFIle=null
inputFileNames[0]="-o"
inputFileNames[1]="OUTPUTFILE"
inputFileNames[2]="INPUTFILE1"
...
cmd -ce -o=OUTPUTFILE INPUTFILE1 INPUTFILE2 INPUTFILE -> failed
will be parsed to:
outputFIle=null
inputFileNames[0]="-o=OUTPUTFILE"
inputFileNames[1]="INPUTFILE1"
...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions