Class: Falcon::Command::Top

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/falcon/command.rb

Instance Method Summary collapse

Instance Method Details

#callObject



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/falcon/command.rb', line 57

def call
  if verbose?
    Async.logger.level = Logger::DEBUG
  elsif quiet?
    Async.logger.level = Logger::WARN
  else
    Async.logger.level = Logger::INFO
  end
  
  if @options[:version]
    puts "#{self.name} v#{Falcon::VERSION}"
  elsif @options[:help]
    self.print_usage
  else
    @command.call
  end
end

#quiet?Boolean



53
54
55
# File 'lib/falcon/command.rb', line 53

def quiet?
  @options[:logging] == :quiet
end

#verbose?Boolean



49
50
51
# File 'lib/falcon/command.rb', line 49

def verbose?
  @options[:logging] == :verbose
end