diff --git a/src/main/java/org/apache/commons/cli/HelpFormatter.java b/src/main/java/org/apache/commons/cli/HelpFormatter.java index 361788054..119a14c2d 100644 --- a/src/main/java/org/apache/commons/cli/HelpFormatter.java +++ b/src/main/java/org/apache/commons/cli/HelpFormatter.java @@ -427,8 +427,10 @@ A appendOptions(final A sb, final int width, final Option // -a is opt and --aaa is long opt; in parallel look for // the longest opt string this list will be then used to // sort options ascending - int max = 0; final int maxSince = showSince ? determineMaxSinceLength(options) + leftPad : 0; + // determineMaxSinceLength() already reserves the width of the "Since" header; the option column needs the + // same floor for the "Options" header, otherwise the gap in front of "Since" below is computed negative. + int max = showSince ? HEADER_OPTIONS.length() + maxSince : 0; final List prefixList = new ArrayList<>(); final List