Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.3
-
None
-
None
Description
If PosixParser.parse(Options options, String[] arguments, Properties properties, boolean stopAtNonOption) is called with stopAtNonOption = TRUE, once parse() finds any non-option parameter, it is supposed to stop parsing and treat all the rest of the parameters 'as is'. But when one or more than one options are appeared before the non-option parameter, the parser continues to parse the parameters even after the non-option parameter.
If the non-option parameter is appeared before any options, the parser stops parsing (as expected).
For example, when the option -x and -y are configured, the PosixParser.parse(options, "nonOption -xvalue1 -yvalue2", properties, TRUE) parses the arguments as 'nonOption, -xvalue1, -yvalue2". But if it is called with "-xvalue1 nonOption -yvalue2", then it parses as '-x, value1, nonOption, -y, value2". For the latter case the 3rd parameter "-yvalue2" should not be parsed.