abstract class TandaCLI::Commands::Base

Included Modules

Direct Known Subclasses

Defined in:

tanda_cli/commands/base.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from module TandaCLI::Commands::RequiredScopes

build_missing_scopes_error_message(scopes : Array(Scopes::OptionalScope)) : String build_missing_scopes_error_message, handle_required_scopes! handle_required_scopes!, scope_message(scope_strings : Array(String)) : String scope_message

Class Method Detail

def self.required_scopes(*args : Scopes::OptionalScope) #

[View source]

Instance Method Detail

def before_run(arguments : Cling::Arguments, options : Cling::Options) : Bool #

override this to extend #pre_run behaviour


[View source]
def on_error(ex : Exception) #

A hook method for when the command raises an exception during execution


[View source]
def 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


[View source]
def on_missing_arguments(arguments : Array(String)) #

A hook method for when the command receives missing arguments during execution


[View source]
def on_missing_options(options : Array(String)) #

A hook method for when the command receives missing options that are required during execution


[View source]
def on_unknown_arguments(arguments : Array(String)) #

A hook method for when the command receives unknown arguments during execution


[View source]
def on_unknown_options(options : Array(String)) #

A hook method for when the command receives unknown options during execution


[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]
def run(arguments : Cling::Arguments, options : Cling::Options) : Nil #
Description copied from class Cling::Command

The main point of execution for the command, where arguments and options can be accessed.


[View source]
abstract def run_(arguments : Cling::Arguments, options : Cling::Options) #

[View source]
def setup : Nil #
Description copied from class Cling::Command

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.


[View source]
abstract def setup_ #

[View source]