|
218 | 218 | import org.apache.batik.util.XMLResourceDescriptor; |
219 | 219 | import org.apache.commons.cli.CommandLine; |
220 | 220 | import org.apache.commons.cli.DefaultParser; |
221 | | -import org.apache.commons.cli.HelpFormatter; |
222 | 221 | import org.apache.commons.cli.Options; |
223 | 222 | import org.apache.commons.cli.ParseException; |
| 223 | +import org.apache.commons.cli.help.HelpFormatter; |
| 224 | +import org.apache.commons.cli.help.TextHelpAppendable; |
224 | 225 | import org.freedesktop.dbus.annotations.DBusBoundProperty; |
225 | 226 | import org.freedesktop.dbus.annotations.DBusInterfaceName; |
226 | 227 | import org.freedesktop.dbus.annotations.DBusProperty.Access; |
@@ -1741,10 +1742,12 @@ public static void main(final String[] args) { |
1741 | 1742 |
|
1742 | 1743 | final var stringWriter = new StringWriter(); |
1743 | 1744 | try (final var printWriter = new PrintWriter(stringWriter)) { |
1744 | | - final var helpFormatter = new HelpFormatter(); |
1745 | | - helpFormatter.printHelp(printWriter, helpFormatter.getWidth(), Constants.APPLICATION_NAME, null, OPTIONS, |
1746 | | - helpFormatter.getLeftPadding(), helpFormatter.getDescPadding(), null, true); |
| 1745 | + final var helpFormatter = HelpFormatter.builder().setHelpAppendable(new TextHelpAppendable(printWriter)) |
| 1746 | + .setShowSince(false).get(); |
| 1747 | + helpFormatter.printHelp(Constants.APPLICATION_NAME, null, OPTIONS, null, true); |
1747 | 1748 | printWriter.flush(); |
| 1749 | + } catch (final IOException e) { |
| 1750 | + throw new RuntimeException(e); |
1748 | 1751 | } |
1749 | 1752 | printCommandLineMessage(stringWriter.toString()); |
1750 | 1753 | } |
|
0 commit comments