abstract class Docr::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 debug(data : _) : Nil #

[View source]
def error(data : _) : Nil #

[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 info(data : _) : Nil #

[View source]
def on_error(ex : Exception) #
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_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]