abstract class TandaCLI::Commands::Base

Direct Known Subclasses

Defined in:

tanda_cli/commands/base.cr

Constructors

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(context : Context) #

[View source]

Macro Detail

macro requires_auth! #

[View source]

Instance Method Detail

def add_commands(*commands : Base.class) #

overrides Cling::Command#add_commands


[View source]
def before_run(arguments : Cling::Arguments, options : Cling::Options) : Bool #

override this to extend #pre_run behaviour


[View source]
def client(*args, **options) #

[View source]
def client(*args, **options, &) #

[View source]
def config(*args, **options) #

[View source]
def config(*args, **options, &) #

[View source]
def context : Context #

[View source]
def current(*args, **options) #

[View source]
def current(*args, **options, &) #

[View source]
def display(*args, **options) #

[View source]
def display(*args, **options, &) #

[View source]
def input(*args, **options) #

[View source]
def input(*args, **options, &) #

[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 requires_auth? : Bool #

[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]