Class CommandLine.Model.CommandSpec

java.lang.Object
nz.org.riskscape.picocli.CommandLine.Model.CommandSpec
Enclosing class:
CommandLine.Model

public static class CommandLine.Model.CommandSpec extends Object
The CommandSpec class models a command specification, including the options, positional parameters and subcommands supported by the command, as well as attributes for the version help message and the usage help message of the command.

Picocli views a command line application as a hierarchy of commands: there is a top-level command (usually the Java class with the main method) with optionally a set of command line options, positional parameters and subcommands. Subcommands themselves can have options, positional parameters and nested sub-subcommands to any level of depth.

The object model has a corresponding hierarchy of CommandSpec objects, each with a set of CommandLine.Model.OptionSpec, CommandLine.Model.PositionalParamSpec and subcommands associated with it. This object model is used by the picocli command line interpreter and help message generator.

Picocli can construct a CommandSpec automatically from classes with @Command, @Option and @Parameters annotations. Alternatively a CommandSpec can be constructed programmatically.

Since:
3.0