abstract class Crimson::Commands::Base

Direct Known Subclasses

Defined in:

commands/base.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def fatal(data : _) : NoReturn #

[View source]
def help_template : String #
Description copied from class Cling::Command

Returns the help template for this command. By default, one is generated interally unless this method is overridden.


[View source]
def on_error(ex : Exception) : Nil #
Description copied from class Cling::Command

A hook method for when the command raises an exception during execution. By default, this raises the exception.


[View source]
def on_invalid_option(message : String) #
Description copied from class Cling::Command

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.


[View source]
def on_missing_arguments(args : Array(String)) #
Description copied from class Cling::Command

A hook method for when the command receives missing arguments during execution. By default, this raises a CommandError.


[View source]
def on_unknown_arguments(args : Array(String)) #
Description copied from class Cling::Command

A hook method for when the command receives unknown arguments during execution. By default, this raises a CommandError.


[View source]
def on_unknown_options(options : Array(String)) #
Description copied from class Cling::Command

A hook method for when the command receives unknown options during execution. By default, this raises an CommandError.


[View source]
def pre_run(arguments : Cling::Arguments, options : Cling::Options) : Nil #
Description copied from class Cling::Command

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.


[View source]