After more exploration it seems that HelpFormatter is really not designed to be extended. I will have to rethink this. It may make sense to make some of the HelpFormatter methods static so that they can be used in other implementations.
On Wed, Sep 18, 2024 at 9:29 AM Claude Warren <cla...@xenei.com> wrote: > Greetings, > > I have a case in RAT where we want to append a line to the help text when > the option has multiple arguments or when we have defined a default value. > > I have implemented this in a renderOptions() implementation in CLI 1.8.0. > In both cases we use the Option to check for some state and then append to > the optBuf. > > I am now migrating to 1.9.0 and have to do the same thing, but 1.9.0 adds > more functionality to the default renderOptions() method so I have to > rework my implementation. However, had I not known this was the case, I > would have missed the changes and we would have had some rather interesting > bugs later. > > What I am proposing is a new parameter to renderOptions(). A > "Optional<String> Function<Option>". If the function returns a String then > it is appended to the optBuf. > > This method would be called near the end of renderOptions. > > Thoughts? > Claude > > -- > LinkedIn: http://www.linkedin.com/in/claudewarren > -- LinkedIn: http://www.linkedin.com/in/claudewarren