commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLI-266) HelpFormatter#setOptionComparator(null) doesn't display the values in inserted order
Date Tue, 21 Jun 2016 20:45:58 GMT

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

ASF GitHub Bot commented on CLI-266:
------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/commons-cli/pull/6


> HelpFormatter#setOptionComparator(null) doesn't display the values in inserted order
> ------------------------------------------------------------------------------------
>
>                 Key: CLI-266
>                 URL: https://issues.apache.org/jira/browse/CLI-266
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x, Help formatter
>    Affects Versions: 1.3.1
>         Environment: Windows
>            Reporter: Ravi Teja
>            Assignee: Benedikt Ritter
>              Labels: easyfix
>             Fix For: 1.4
>
>
> {code:java}
> OptionGroup group = new OptionGroup();
> Option h = Option.builder("h").build();
> Option s = Option.builder("s").build();
> Option b = Option.builder("b").build();
> Option t = Option.builder("t").build();
> group.addOption(h)
>     .addOption(s)
>     .addOption(b)
>     .addOption(t);
> Options options = new Options();
> options.addOptionGroup(group);
> options.addOption(Option.builder("o").build());
> HelpFormatter formatter = new HelpFormatter();
> formatter.setOptionComparator(null);
> formatter.printHelp("cmd", "", options, null);
> {code}
> This code does print the options(1. Group, 2. Option "o") in the order of insertion but
the groups order of display is messed up.
> The OptionGroup internally uses a HashMap. If that could be replaced with a *LinkedHashMap*
this issue can be solved.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message