Cling::Command
Inherits Reference < Object
Constructors
Instance methods
Adds a command as a subcommand to the parent. The command can then be referenced by specifying it as the first argument in the command line.
Adds several commands as subcommands to the parent (see add_command).
A hash of arguments belonging to the command. These arguments are parsed at execution time
and can be accessed in the pre_run, run, and post_run methods via ArgumentsInput.
The description of the command to show for specific help with the command.
Executes the command with the given input and parser (see Parser). Returns the program exit
status code, by default it is 0.
Raises an ExitProgram exception to exit the program. By default it is 1.
A header message to display at the top of generated help templates.
Returns the help template for this command. By default, one is generated interally unless this method is overridden.
Whether the command should inherit the header and footer strings from the parent command.
Whether the command should inherit the header and footer strings from the parent command.
Whether the command should inherit the options from the parent command.
Whether the command should inherit the IO streams from the parent command.
Returns true if the argument matches the command name or any aliases.
The name of the command. This is the only required field of a command and cannot be empty or blank.
The name of the command. This is the only required field of a command and cannot be empty or blank.
A hook method for when the command raises an exception during execution. By default, this raises the exception.
A hook method for when the command receives an invalid option, for example, a value given to
an option that takes no arguments. By default, this raises a CommandError.
A hook method for when the command receives missing arguments during execution. By default,
this raises a CommandError.
A hook method for when the command receives missing options that are required during
execution. By default, this raises an CommandError.
A hook method for when the command receives unknown arguments during execution. By default,
this raises a CommandError.
A hook method for when the command receives unknown options during execution. By default,
this raises an CommandError.
A hash of flag options belonging to the command. These options are parsed at execution time
and can be accessed in the pre_run, run, and post_run methods via OptionsInput.
The parent of the command of which the current command inherits from.
A hook method to run once the pre_run and main run methods have been executed.
A hook method to run once the command/subcommands, arguments and options have been parsed.
This has access to the parsed arguments and options from the command line. This is useful if
you want to implement checks for specific flags outside of the main run method, such as
-v/--version flags or -h/--help flags.
The main point of execution for the command, where arguments and options can be accessed.
An abstract method that should define information about the command such as the name, aliases, arguments, options, etc. The command name is required for all commands, all other values are optional including the help message.
The standard error stream for commands (defaults to STDERR). This is a helper method for
custom commands and is only used by the MainCommand helper class.
The standard error stream for commands (defaults to STDERR). This is a helper method for
custom commands and is only used by the MainCommand helper class.
The standard input stream for commands (defaults to STDIN). This is a helper method for
custom commands and is only used by the MainCommand helper class.
The standard input stream for commands (defaults to STDIN). This is a helper method for
custom commands and is only used by the MainCommand helper class.
The standard output stream for commands (defaults to STDOUT). This is a helper method for
custom commands and is only used by the MainCommand helper class.
The standard output stream for commands (defaults to STDOUT). This is a helper method for
custom commands and is only used by the MainCommand helper class.
The summary of the command to show in generated help templates.