lib/hanami/cli.rb in hanami-cli-0.1.1 vs lib/hanami/cli.rb in hanami-cli-0.2.0.beta1
- old
+ new
@@ -5,10 +5,11 @@
# General purpose Command Line Interface (CLI) framework for Ruby
#
# @since 0.1.0
class CLI
require "hanami/cli/version"
+ require "hanami/cli/errors"
require "hanami/cli/command"
require "hanami/cli/registry"
require "hanami/cli/parser"
require "hanami/cli/usage"
require "hanami/cli/banner"
@@ -49,10 +50,13 @@
def call(arguments: ARGV, out: $stdout)
result = commands.get(arguments)
if result.found?
command, args = parse(result, out)
+
+ result.before_callbacks.run(self, args)
command.call(args)
+ result.after_callbacks.run(self, args)
else
usage(result, out)
end
end