[jira] Updated: (CLI-122) Create test for this for 2.0

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CLI-122) Create test for this for 2.0

Bruno P. Kinoshita (Jira)

     [ https://issues.apache.org/jira/browse/CLI-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Egge updated CLI-122:
---------------------------

    Attachment: CLI122.patch

In CLI 1.x you don't have variable arguments and default values.  I.e., an argument which takes 2-4 values, so CLI 1.x can safely say something is or isn't an option based on it's context, and not based on if it starts with a dash.

In CLI 2.x, you do have variable args, and the parser uses a 'looksLikeAnOption' function to determine if the argument is the next one in a list, or is the start of the next option.  

However, there is still a need to be able to parse arguments which starts with a dash.  The attached patch allows these to forms to work:

--argument "-foo"
--argument=-foo

However, this form will still not:
--argument -foo



> Create test for this for 2.0
> ----------------------------
>
>                 Key: CLI-122
>                 URL: https://issues.apache.org/jira/browse/CLI-122
>             Project: Commons CLI
>          Issue Type: Sub-task
>          Components: CLI-2.x
>            Reporter: Henri Yandell
>             Fix For: 2.0
>
>         Attachments: CLI122.patch
>
>
> The issue is reported against the 1.0 API, but we should either add the feature or a unit test for 2.x.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.