Issue Details (XML | Word | Printable)

Key: CLI-155
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Mike DeLaurentis
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons CLI

Allow caller to define ordering of options in help message

Created: 12/May/08 07:45 PM   Updated: 29/May/08 01:03 PM
Return to search
Component/s: Help formatter
Affects Version/s: None
Fix Version/s: 1.2

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works CLI-155.patch 2008-05-13 04:54 AM Henri Yandell 5 kB

Resolution Date: 13/May/08 04:55 AM


 Description  « Hide
It would be nice if the caller could define their own ordering of command-line options, as an alternative to alphabetical ordering. I see there's an OptionComparator class within HelpFormatter. Maybe you could add a setOptionComparator(Comparator comp) method.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Henri Yandell added a comment - 13/May/08 04:54 AM
Attaching patch that implements this with unit test.

Henri Yandell made changes - 13/May/08 04:54 AM
Field Original Value New Value
Attachment CLI-155.patch [ 12381921 ]
Repository Revision Date User Message
ASF #655735 Tue May 13 04:54:59 UTC 2008 bayard Making the OptionComparator modifiable so people can change the order in which arguments are printed by the HelpFormatter - as requested in CLI-155
Files Changed
MODIFY /commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java
MODIFY /commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/HelpFormatter.java

Henri Yandell added a comment - 13/May/08 04:55 AM
svn ci -m "Making the OptionComparator modifiable so people can change the order in which arguments are printed by the HelpFormatter - as requested in CLI-155"

Sending src/java/org/apache/commons/cli/HelpFormatter.java
Sending src/test/org/apache/commons/cli/HelpFormatterTest.java
Transmitting file data ..
Committed revision 655735.


Henri Yandell made changes - 13/May/08 04:55 AM
Fix Version/s 1.2 [ 12312674 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Emmanuel Bourg made changes - 29/May/08 01:03 PM
Component/s CLI-1.x [ 12311672 ]
Component/s Help formatter [ 12312373 ]