Help
Built-in help command, javadoc-driven man pages, and three sources for command and option descriptions.
Crest provides a built-in help command that generates documentation automatically from your command definitions. No configuration is required – help is registered and available out of the box.
The feature
- The Help Command – what
myapp helpdoes, command listings, man-page sections, and how output is rendered in the terminal.
Three approaches to writing help
Crest pulls description text from three sources, in priority order. Mix and match across commands – pick the approach that fits each case.
- Javadoc – the richest approach. Method javadoc becomes the DESCRIPTION section, with paragraphs, headings, bullets, and preformatted blocks.
@paramtags fall back as option descriptions. Best for commands that need real documentation. - Annotation Descriptions –
@Command(description)and@Option(description)for inline, single-line text. Best for short commands and trivial options. - Resource Bundles –
OptionDescriptions.propertiesfor centralized, per-package option text. Best for shared vocabularies and i18n.
Writing good help
- Best Practices – conventions for help text that actually helps the next person to run the command.
- Example – a real command shown end-to-end: source javadoc and rendered terminal output.
The Help Command
How the built-in help command works: command listings, man-page sections, and terminal rendering.
Javadoc
Use method javadoc for command help. DocumentParser supports paragraphs, headings, bullets, preformatted blocks, and inline emphasis.
Annotation Descriptions
Use @Command(description), @Command(usage), and @Option(description) for inline, single-line help text.
Resource Bundles
Centralize option descriptions in OptionDescriptions.properties for sharing across commands and i18n.
Best Practices
Conventions for writing command help that actually helps the next person to run the command.
Example
A real Crest command shown end-to-end: source javadoc and rendered terminal output.