Class: Sumo::CLI
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- Sumo::CLI
- Defined in:
- lib/sumo/cli.rb
Overview
This class is used to define a CLI.
Instance Method Summary collapse
-
#execute ⇒ Object
This method is called when the CLI is run.
Instance Method Details
#execute ⇒ Object
This method is called when the CLI is run.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sumo/cli.rb', line 25 def execute if version? $stdout.puts Sumo::VERSION elsif records? search.records.each { |record| $stdout.puts record } else search..each { |msg| $stdout.puts (msg['_raw']) } end rescue StandardError => ex $stderr.puts "#{ex.class}: #{ex.}" exit 1 end |