Skip to content

Commit

Permalink
[#1184] Added public method Help::calcLongOptionColumnWidth
Browse files Browse the repository at this point in the history
Closes #1184
  • Loading branch information
remkop committed Oct 26, 2020
1 parent f124ed7 commit fc5ef6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Picocli follows [semantic versioning](http://semver.org/).
## <a name="4.6.0-new"></a> New and Noteworthy

## <a name="4.6.0-fixes"></a> Fixed issues
* [#1184] API: Added public methods `Help.Layout::colorScheme`, `Help.Layout::textTable`, `Help.Layout::optionRenderer`, and `Help.Layout::parameterRenderer`.
* [#1184] API: Added public methods `Help.Layout::colorScheme`, `Help.Layout::textTable`, `Help.Layout::optionRenderer`, `Help.Layout::parameterRenderer`, and `Help::calcLongOptionColumnWidth`.
* [#1225] Bugfix: Error message for unmatched positional argument reports incorrect index when value equals a previously matched argument. Thanks to [Vitaly Shukela](https://github.com/vi) for raising this.
* [#1215] DOC: User manual improvements, including more tabs with Kotlin source code. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
* [#1219] DOC: User manual improvements: added more tabs with Kotlin code. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -15090,7 +15090,13 @@ private Layout createLayout(int longOptionsColumnWidth, ColorScheme aColorScheme
return new Layout(aColorScheme, tt, createDefaultOptionRenderer(), createDefaultParameterRenderer());
}

private int calcLongOptionColumnWidth(List<OptionSpec> options, List<PositionalParamSpec> positionalParamSpecs, ColorScheme aColorScheme) {
/** Returns the width of the long options column in the usage help message.
* @param options the options shown in the usage help message
* @param positionals the positional parameters shown in the usage help message
* @param aColorScheme the colorscheme used in the layout to create {@linkplain Text} values
* @return the width of the long options column in the layout
* @since 4.6 */
public int calcLongOptionColumnWidth(List<OptionSpec> options, List<PositionalParamSpec> positionals, ColorScheme aColorScheme) {
int max = 0;
IOptionRenderer optionRenderer = new DefaultOptionRenderer(false, " ");
boolean cjk = commandSpec.usageMessage().adjustLineBreaksForWideCJKCharacters();
Expand Down

0 comments on commit fc5ef6d

Please sign in to comment.