Claudenw commented on PR #579: URL: https://github.com/apache/creadur-rat/pull/579#issuecomment-3511638223
To fix this PR the following actions should be taken. Change from `org.apache.commons.cli.HelpFormatter` to `org.apache.commons.cli.help.HelpFormatter` And then understand that the new help formatter is intended to be built just before use. The `AbstractHelp` class - get rid of `AbstractHelp.RatHelpFormatter` class. - should add a `HelpFormatter.Builder` protected final instance variable - the `HelpFormatter.Builder` should setShowSince to `true` - the `HelpFormatter.Builder` should setComparator to `OptionCollection.OPTION_COMPARATOR` - he `HelpFormatter.Builder` should setOptionFormatBuilder to a instance of OptionFormatBuilder that has setDeprecatedFormatFunction set to `DEPRECATED_MSG`. In the `rat.Help` class `printUsage` method - A `TextAppendable` should be created that wraps the current writer. - The `TextAppendable` should have the max width set to the current `HELP_WIDTH` - set the `HelpFormatter.Builder.setHelpAppendable` to the `TextAppendable`; - call `HeloFormatter.Builder.get().printHelp(syntax, "", opts, "", true); That will get us most of the way there for the basic help. For the formatting of additional info use the `TextHelpAppendable.printWrapped()`, or create a table and use `TextHelpAppendable.appendTable()` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
