Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add convenience method Help.fullSynopsis() #836

Closed
remkop opened this issue Oct 11, 2019 · 0 comments
Closed

Add convenience method Help.fullSynopsis() #836

remkop opened this issue Oct 11, 2019 · 0 comments

Comments

@remkop
Copy link
Owner

remkop commented Oct 11, 2019

Add convenience method Help.fullSynopsis() as follows:

Help help = new Help(spec, cmd.getColorScheme());
writer.print(help.synopsisHeading() + help.synopsis(help.synopsisHeadingLength());

That would make this easier: #480

Also, add CommandLine.getHelp():

// CommandLine
/** Returns a new {@code Help} object created by the {@code IHelpFactory} with the {@code CommandSpec} and {@code ColorScheme} of this command.
 * @see Help#Help(CommandSpec, Help.ColorScheme)
 * @see #getHelpFactory()
 * @see #getCommandSpec()
 * @see #getColorScheme() 
 * @since 4.1
 */
public Help getHelp() {
    return getHelpFactory().create(getCommandSpec(), getColorScheme());
}
@remkop remkop added this to the 4.2 milestone Oct 11, 2019
@remkop remkop modified the milestones: 4.2, 4.1 Oct 11, 2019
remkop added a commit that referenced this issue Oct 11, 2019
@remkop remkop closed this as completed Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant