cbeust / jcommander

Command line parsing framework for Java
Apache License 2.0
1.95k stars 332 forks source link

Fix regression with removed usage methods #523

Closed thnaeff closed 2 years ago

thnaeff commented 3 years ago

Fixes a regression introduced with #408 where various usage methods got removed resulting in an API breaking change. Since this did not get a major version increase, I am thinking this should not happen. I can deprecate those methods and point to the usage formatter documentation and possibly using something like

    DefaultUsageFormatter usage = new DefaultUsageFormatter(jc);
    usage.usage("", sb);

instead of those methods, but then the JCommander#setUsageFormatter(IUsageFormatter) is kid of redundant and not used/needed.

I only made these changes via online editor so far and did not test/compile them. If someone can do that before merging that would be great of course, otherwise I can try to do it if this gets approved.

Might fix issue #483 (I see an instance of commander.usage(sb);)

thnaeff commented 2 years ago

@cbeust Let me know if there is anything else needed to get this PR merged.