public static class CommandLine.Model.UsageMessageSpec
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_USAGE_WIDTH
Constant holding the default usage message width:
80. |
| Constructor and Description |
|---|
UsageMessageSpec() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
abbreviateSynopsis()
Returns whether the synopsis line(s) should show an abbreviated synopsis without detailed option names.
|
CommandLine.Model.UsageMessageSpec |
abbreviateSynopsis(boolean newValue)
Sets whether the synopsis line(s) should show an abbreviated synopsis without detailed option names.
|
java.lang.String |
commandListHeading()
Returns the optional heading preceding the subcommand list.
|
CommandLine.Model.UsageMessageSpec |
commandListHeading(java.lang.String newValue)
Sets the optional heading preceding the subcommand list.
|
java.lang.String[] |
customSynopsis()
Returns the optional custom synopsis lines to use instead of the auto-generated synopsis.
|
CommandLine.Model.UsageMessageSpec |
customSynopsis(java.lang.String... customSynopsis)
Sets the optional custom synopsis lines to use instead of the auto-generated synopsis.
|
java.lang.String[] |
description()
Returns the optional text lines to use as the description of the help message, displayed between the synopsis and the
options list.
|
CommandLine.Model.UsageMessageSpec |
description(java.lang.String... description)
Sets the optional text lines to use as the description of the help message, displayed between the synopsis and the
options list.
|
java.lang.String |
descriptionHeading()
Returns the optional heading preceding the description section.
|
CommandLine.Model.UsageMessageSpec |
descriptionHeading(java.lang.String newValue)
Sets the heading preceding the description section.
|
java.lang.String[] |
footer()
Returns the optional footer text lines displayed at the bottom of the help message.
|
CommandLine.Model.UsageMessageSpec |
footer(java.lang.String... footer)
Sets the optional footer text lines displayed at the bottom of the help message.
|
java.lang.String |
footerHeading()
Returns the optional heading preceding the footer section.
|
CommandLine.Model.UsageMessageSpec |
footerHeading(java.lang.String newValue)
Sets the optional heading preceding the footer section.
|
java.lang.String[] |
header()
Returns the optional header lines displayed at the top of the help message.
|
CommandLine.Model.UsageMessageSpec |
header(java.lang.String... header)
Sets the optional header lines displayed at the top of the help message.
|
java.lang.String |
headerHeading()
Returns the optional heading preceding the header section.
|
CommandLine.Model.UsageMessageSpec |
headerHeading(java.lang.String headerHeading)
Sets the heading preceding the header section.
|
boolean |
hidden()
Returns whether this command should be hidden from the usage help message of the parent command.
|
CommandLine.Model.UsageMessageSpec |
hidden(boolean value)
Set the hidden flag on this command to control whether to show or hide it in the help usage text of the parent command.
|
java.lang.String |
optionListHeading()
Returns the optional heading preceding the options list.
|
CommandLine.Model.UsageMessageSpec |
optionListHeading(java.lang.String newValue)
Sets the heading preceding the options list.
|
java.lang.String |
parameterListHeading()
Returns the optional heading preceding the parameter list.
|
CommandLine.Model.UsageMessageSpec |
parameterListHeading(java.lang.String newValue)
Sets the optional heading preceding the parameter list.
|
char |
requiredOptionMarker()
Returns the character used to prefix required options in the options list.
|
CommandLine.Model.UsageMessageSpec |
requiredOptionMarker(char newValue)
Sets the character used to prefix required options in the options list.
|
boolean |
showDefaultValues()
Returns whether the options list in the usage help message should show default values for all non-boolean options.
|
CommandLine.Model.UsageMessageSpec |
showDefaultValues(boolean newValue)
Sets whether the options list in the usage help message should show default values for all non-boolean options.
|
boolean |
sortOptions()
Returns whether the options list in the usage help message should be sorted alphabetically.
|
CommandLine.Model.UsageMessageSpec |
sortOptions(boolean newValue)
Sets whether the options list in the usage help message should be sorted alphabetically.
|
java.lang.String |
synopsisHeading()
Returns the optional heading preceding the synopsis.
|
CommandLine.Model.UsageMessageSpec |
synopsisHeading(java.lang.String newValue)
Sets the optional heading preceding the synopsis.
|
int |
width()
Returns the maximum usage help message width.
|
CommandLine.Model.UsageMessageSpec |
width(int newValue)
Sets the maximum usage help message width to the specified value.
|
public static final int DEFAULT_USAGE_WIDTH
80.public int width()
"picocli.usage.width"
if set, otherwise returns the value set via the width(int) method, or if not set, the default width.public CommandLine.Model.UsageMessageSpec width(int newValue)
newValue - the new maximum usage help message width. Must be 55 or greater.UsageMessageSpec for method chainingjava.lang.IllegalArgumentException - if the specified width is less than 55public java.lang.String headerHeading()
CommandLine.Command.headerHeading(), or null.public java.lang.String[] header()
CommandLine.Command.header()
if the Command annotation is present, otherwise this is an empty array and the help message has no
header. Applications may programmatically set this field to create a custom help message.public java.lang.String synopsisHeading()
CommandLine.Command.synopsisHeading(), "Usage: " by default.public boolean abbreviateSynopsis()
public java.lang.String[] customSynopsis()
CommandLine.Command.customSynopsis() if the Command annotation is present,
otherwise this is an empty array and the synopsis is generated.
Applications may programmatically set this field to create a custom help message.public java.lang.String descriptionHeading()
CommandLine.Command.descriptionHeading(), or null.public java.lang.String[] description()
CommandLine.Command.description() if the Command annotation is present,
otherwise this is an empty array and the help message has no description.
Applications may programmatically set this field to create a custom help message.public java.lang.String parameterListHeading()
CommandLine.Command.parameterListHeading(), or null.public java.lang.String optionListHeading()
CommandLine.Command.optionListHeading(), or null.public boolean sortOptions()
public char requiredOptionMarker()
public boolean showDefaultValues()
public boolean hidden()
true if this command should not appear in the usage help message of the parent commandpublic java.lang.String commandListHeading()
CommandLine.Command.commandListHeading(). "Commands:%n" by default.public java.lang.String footerHeading()
CommandLine.Command.footerHeading(), or null.public java.lang.String[] footer()
CommandLine.Command.footer() if the Command annotation is present, otherwise this is an empty array and
the help message has no footer.
Applications may programmatically set this field to create a custom help message.public CommandLine.Model.UsageMessageSpec headerHeading(java.lang.String headerHeading)
CommandLine.Command.headerHeading(), or null.public CommandLine.Model.UsageMessageSpec header(java.lang.String... header)
public CommandLine.Model.UsageMessageSpec synopsisHeading(java.lang.String newValue)
public CommandLine.Model.UsageMessageSpec abbreviateSynopsis(boolean newValue)
public CommandLine.Model.UsageMessageSpec customSynopsis(java.lang.String... customSynopsis)
public CommandLine.Model.UsageMessageSpec descriptionHeading(java.lang.String newValue)
public CommandLine.Model.UsageMessageSpec description(java.lang.String... description)
public CommandLine.Model.UsageMessageSpec parameterListHeading(java.lang.String newValue)
public CommandLine.Model.UsageMessageSpec optionListHeading(java.lang.String newValue)
public CommandLine.Model.UsageMessageSpec sortOptions(boolean newValue)
public CommandLine.Model.UsageMessageSpec requiredOptionMarker(char newValue)
public CommandLine.Model.UsageMessageSpec showDefaultValues(boolean newValue)
public CommandLine.Model.UsageMessageSpec hidden(boolean value)
value - enable or disable the hidden flagCommandLine.Command.hidden()public CommandLine.Model.UsageMessageSpec commandListHeading(java.lang.String newValue)
public CommandLine.Model.UsageMessageSpec footerHeading(java.lang.String newValue)
public CommandLine.Model.UsageMessageSpec footer(java.lang.String... footer)