struct Athena::Console::Loader::Factory
inherits Struct
#
A default implementation of ACON::Loader::Interface
that accepts a Hash(String, Proc(ACON::Command))
.
A factory could then be set on the ACON::Application
:
application = MyCustomApplication.new "My CLI"
application.command_loader = Athena::Console::Loader::Factory.new({
"command1" => Proc(ACON::Command).new { Command1.new },
"app:create-user" => Proc(ACON::Command).new { CreateUserCommand.new },
})
application.run
Included modules
Athena::Console::Loader::Interface
Constructors#
Methods#
#get(name : String) : ACON::Command
#
Returns an ACON::Command
with the provided name.
Raises ACON::Exceptions::CommandNotFound
if it is not defined.
#has?(name : String) : Bool
#
Returns true
if self
has a command with the provided name, otherwise false
.