Class: OsUp::Cli::Command

Inherits:
OsCtl::Lib::Cli::Command
  • Object
show all
Defined in:
lib/osup/cli/command.rb

Direct Known Subclasses

Main, Runner

Class Method Summary collapse

Class Method Details

.run(klass, method) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/osup/cli/command.rb', line 5

def self.run(klass, method)
  proc do |global_opts, opts, args|
    if global_opts[:debug]
      OsCtl::Lib::Logger.setup(:stdout)
    else
      OsCtl::Lib::Logger.setup(:none)
    end

    cmd = klass.new(global_opts, opts, args)
    cmd.method(method).call
  end
end