Cannot pass negative number as option value #1077
Labels
branch/3.1.x
Issue for a branch
branch/3.2.x
Issue for a branch
for/backport
For backporting
type/bug
Is a bug report
Milestone
The issue #651 resolved this problem last year, but the problem has been reintroduced.
The issue was probably reintroduced as part of the "command parser rework" from commit: 75b8a0c
To reproduce this issue just add the following test to the nested class:
org.springframework.shell.command.parser.ParserTests.TypeConversions
The following are the values for the ParseResult object when the above test is executed. The result shows that the -1 option value is being parsed as an UNRECOGNISED_OPTION instead of an option value:
The current workaround solution is to use a bash style double-dash "--" to stop any option processing, and to provide the option value as positional command argument.
For example: Use
command -- -1
, instead ofcommand --arg1 -1
The text was updated successfully, but these errors were encountered: