public class ManPageGenerator
extends java.lang.Object
implements java.util.concurrent.Callable<java.lang.Integer>
This class can be used as a subcommand, in which case it generates man pages for all
non-hidden commands in the hierarchy from the top-level command down,
or it can be executed as a stand-alone tool, in which case the user needs to specify
the @Command-annotated classes to generate man pages for.
| Constructor and Description |
|---|
ManPageGenerator() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
call()
Invokes
generateManPage(Config, CommandLine.Model.CommandSpec...) to generate man pages for
all non-hidden commands in the hierarchy from the top-level command down. |
static int |
generateManPage(java.io.File outdir,
java.io.File customizablePagesDirectory,
boolean[] verbosity,
boolean overwriteCustomizablePages,
picocli.CommandLine.Model.CommandSpec... specs)
Generates AsciiDoc files for the specified classes to the specified output directory,
optionally also generating template files in the
customizablePagesDirectory directory. |
static void |
main(java.lang.String[] args)
Invokes
generateManPage(Config, CommandLine.Model.CommandSpec...) to generate man pages for
the user-specified @Command-annotated classes. |
static void |
writeSingleManPage(java.io.PrintWriter pw,
picocli.CommandLine.Model.CommandSpec spec) |
public java.lang.Integer call()
throws java.io.IOException
generateManPage(Config, CommandLine.Model.CommandSpec...) to generate man pages for
all non-hidden commands in the hierarchy from the top-level command down.
This method is only called when this class is used as a subcommand.call in interface java.util.concurrent.Callable<java.lang.Integer>java.io.IOException - if a problem occurred writing files.public static void main(java.lang.String[] args)
generateManPage(Config, CommandLine.Model.CommandSpec...) to generate man pages for
the user-specified @Command-annotated classes.
If the --exit option is specified, System.exit is invoked
afterwards with an exit code as follows:
args - command line arguments to be parsed. Must include the classes to
generate man pages for.public static int generateManPage(java.io.File outdir,
java.io.File customizablePagesDirectory,
boolean[] verbosity,
boolean overwriteCustomizablePages,
picocli.CommandLine.Model.CommandSpec... specs)
throws java.io.IOException
customizablePagesDirectory directory.outdir - Output directory to write the generated AsciiDoc files to.customizablePagesDirectory - Optional directory to write customizable man page template files.
If non-null, an additional "template" file is created here for each
generated manpage AsciiDoc file.verbosity - the length of this array determines verbosity during processingoverwriteCustomizablePages - Overwrite existing man page templates.
The default is false, meaning processing is aborted and the process exits
with status code 4 if a man page template file already exists.specs - the Commands to generate AsciiDoc man pages forjava.io.IOException - if a problem occurred writing to the file systempublic static void writeSingleManPage(java.io.PrintWriter pw,
picocli.CommandLine.Model.CommandSpec spec)