By default, picocli only shows an overview of a command's subcommands, and no details. This follows the conventions of other command suites like git
. The idea is that end users can always get details for another subcommand by asking for help for that specific subcommand, like git commit --help
, or git help commit
.
While this is a useful default, if that's not what you want, picocli usage help is highly customizable.
The picocli usage message has the following sections:
- header heading
- header
- synopsis heading
- synopsis
- description heading
- description
- positional parameter list heading
- positional parameter list
- option list heading
- option list
- command list heading
- command list
- exit code list heading (since 4.0)
- exit code list (since 4.0)
- footer heading
- footer
Each section has its own IHelpSectionRenderer, and you can change the usage help by removing, reordering or replacing these help section renderers.
An example to get you started is here:
https://github.com/remkop/picocli/blob/master/picocli-examples/src/main/java/picocli/examples/customhelp/ShowAll.java
The above example has a custom IHelpSectionRenderer
for the command list, to show the full hierarchy of commands, subcommands, and sub-subcommands, etc. You may want to do something similar but show the options of the subcommands instead.
You will need to familiarize yourself with some details of the picocli Help API, like TextTable, Layout, IOptionRenderer, etc.