class

Geode::Commands::Base

Inherits Cling::Command / Reference / Object

Constructors

Instance methods

help_template

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

Source
on_error(ex : Exception)

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

Source
on_invalid_option(message : String)

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.

Source
on_missing_arguments(args : Array(String))

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

Source
on_unknown_arguments(args : Array(String))

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

Source
on_unknown_options(options : Array(String))

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

Source
pre_run(arguments : Cling::Arguments, options : Cling::Options) : Bool

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.

Accepts a Bool or nil argument as a return to specify whether the command should continue to run once finished (true or nil to continue, false to stop).

Source