Clikt Command
The CliktCommand is the core of command line interfaces in Clikt.
Command line interfaces created by creating a subclass of CliktCommand with properties defined with option and argument. You can then parse argv
by calling main, which will take care of printing errors and help to the user. If you want to handle output yourself, you can use parse instead.
Once the command line has been parsed and all of the parameters are populated, run is called.
Parameters
The help for this command. The first line is used in the usage string, and the entire string is used in the help output. Paragraphs are automatically re-wrapped to the terminal width.
Text to display at the end of the full help output. It is automatically re-wrapped to the terminal width.
The name of the program to use in the help output. If not given, it is inferred from the class name.
Used when this command has subcommands, and this command is called without a subcommand. If true, run will be called. By default, a PrintHelpMessage is thrown instead.
If this command is called with no values on the command line, print a help message (by throwing PrintHelpMessage) if this is true, otherwise run normally.
Extra information about this option to pass to the help formatter.
The envvar to use to enable shell autocomplete script generation. Set to null to disable generation.
If true, allow multiple of this command's subcommands to be called sequentially. This will disable allowInterspersedArgs
on the context of this command an its descendants. This functionality is experimental, and may change in a future release.
If true, any options on the command line whose names aren't valid will be parsed as an argument rather than reporting an error. You'll need to define an argument().multiple()
to collect these options, or an error will still be reported. Unknown short option flags grouped with other flags on the command line will always be reported as errors.
If true, don't display this command in help output when used as a subcommand.
Constructors
Functions
Return the full help string for this command.
Return the usage string for this command.
Add a message to be printed after parsing
Register an argument with this command.
Get a read-only list of arguments registered in this command (e.g. via registerArgument or an argument delegate)
Get a read-only list of options registered in this command (e.g. via registerOption or an option delegate)
Get a read-only list of groups registered in this command (e.g. via registerOptionGroup or an OptionGroup delegate)
The names of all direct children of this command
Get a read-only list of commands registered as subcommands of this command.
Register an option with this command or group.
Register an option with this command.
Register a group with this command.
Properties
Inheritors
Extensions
Create a property delegate argument.
Find the closest object of type T, or null
Find the closest object of type T, setting context.obj
if one is not found.
Declare a set of two or more mutually exclusive options.
Create a property delegate option.
Find the closest object of type T, or throw a NullPointerException