[
https://issues.apache.org/jira/browse/CLI-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18078450#comment-18078450
]
Gary D. Gregory commented on CLI-354:
-------------------------------------
Hello [~alerosmile]
Thank you for your report.
Feel free to provide a PR on GitHub, with a unit test of course ;)
TY!
> HelpFormatter: Description indentation is incorrect
> ---------------------------------------------------
>
> Key: CLI-354
> URL: https://issues.apache.org/jira/browse/CLI-354
> Project: Commons CLI
> Issue Type: Bug
> Components: Help formatter
> Affects Versions: 1.11.0
> Reporter: Roman Huber
> Priority: Minor
>
> When using {{{}HelpFormatter{}}}, the description lines are not indented
> consistently.
> As an example, I get this output:
> {noformat}
> -V, --argument-value <value> an argument passed to the remote
> command. The value will be wrapped
> in double quotes and appended to the
> command-line. This option can be
> added multiple times.
> {noformat}
> As shown above, the wrapped description lines are not aligned correctly. Some
> lines are indented one space less than others.
> h4. Expected behavior
> All wrapped description lines should be indented equally, with the exception
> of the first line.
> h4. Suspected cause
> The issue appears to be caused by an incorrect comparison in the indentation
> logic. The
> [condition|https://github.com/apache/commons-cli/blob/7be3807fa6fd4ad29241074f6ddeb23cfc677775/src/main/java/org/apache/commons/cli/help/TextStyle.java#L372]
> currently checks:
> {code:java}
> restLen > indent
> {code}
> It should instead be:
> {code:java}
> restLen >= indent
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)