You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2013/02/16 15:31:13 UTC

[jira] [Comment Edited] (CLI-224) OptionBuilder only has static methods, yet many return an OptionBuilder instance

    [ https://issues.apache.org/jira/browse/CLI-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13575772#comment-13575772 ] 

Thomas Neidhart edited comment on CLI-224 at 2/16/13 2:29 PM:
--------------------------------------------------------------

Added also a default constructor for Option.Builder(), as the current OptionBuilder also allows the following:

{noformat}
  OptionBuilder.withLongOpt("v").create()
{noformat}

with the Builder it will be like this:

{noformat}
  new Option.Builder().longOpt("v").build();
{noformat}

What about a static factory method, as always typing new may be tedious?

{noformat}
  Option.builder().longOpt("v")......build();
{noformat}
                
      was (Author: tn):
    Added also a default constructor for Option.Builder(), as the current OptionBuilder also allows the following:

{noformat}
  OptionBuilder.withLongOpt("v").create()
{noformat}

with the Builder it will be like this:

{noformat}
  new Option.Builder().longOpt("v").build();
{noformat}

What about a static factory method, as always typing new may be tedious:

{noformat}
  Option.Builder.start().longOpt("v")......build();
{noformat}
                  
> OptionBuilder only has static methods, yet many return an OptionBuilder instance
> --------------------------------------------------------------------------------
>
>                 Key: CLI-224
>                 URL: https://issues.apache.org/jira/browse/CLI-224
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.2
>            Reporter: Brian Blount
>             Fix For: 1.3
>
>         Attachments: commons-cli-CLI-224.patch, DefaultOptionBuilder.java, DefaultOptionBuilderTest.java
>
>
> CLI-83 was closed as fixed in 2.0, but it seems that there is no current plan to release CLI 2.0.  Could this fix be rolled into the 1.x line?  I'm attaching a new version of option builder that addresses the issue (named DefaultOptionBuilder to maintain backwards compatability) and a unit test for it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira