Help Generators are classes that take in CLI/Command metadata and output help in some format. The core library includes Text based help generators and additional libraries provide Markdown, HTML, MAN and Bash format help.
In order to generate help you need to create an instance of your desired generator and then pass in the metadata for your CLI/Command. There are three interfaces provided for generating different kinds of help:
GlobalUsageGenerator
- Generates help for CLIsCommandGroupUsageGenerator
- Generates help for command groupsCommandUsageGenerator
- Generates help for commandsFor example for a CLI we might do the following:
Cli<ExampleRunnable> cli = new Cli<ExampleRunnable>(ShipItCli.class);
CliGlobalUsageGenerator<ExampleRunnable> helpGenerator = new CliGlobalUsageGenerator<>();
try {
helpGenerator.usage(cli.getMetadata(), System.out);
} catch (IOException e) {
e.printStackTrace();
}
In this example we output the help to System.out
but we could pass any OutputStream
we desired.
Format | Module | Description |
---|---|---|
Text | airline |
Creates column wrapped plain text suitable for displaying directly on a console |
Markdown | airline-help-markdown |
Creates Markdown formatted help |
HTML | airline-help-html |
Creates HTML format help |
MAN | airline-help-man |
Creates Linux MAN pages in Troff format that can be viewed with the man utility |
Bash | airline-help-bash |
Creates Bash completion scripts |
This documentation is itself open source and lives in GitHub under the docs/ directory.
I am not a professional technical writer and as the developer of this software I can often make assumptions of
knowledge that you as a user reading this may not have. Improvements to the documentation are always welcome, if you
have suggestions for the documentation please submit pull requests to the main
branch.