Help Generators

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.

Generating 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:

For 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.

Available Generators

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

Improving this Documentation

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.