Class: Rbcat::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/rbcat/cli.rb

Class Method Summary collapse

Class Method Details

.start(args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rbcat/cli.rb', line 8

def self.start(args)
  options = parse_options(args)
  colorizer_options = create_colorizer_options(options)

  while (input = $stdin.gets)
    input.each_line do |line|
      puts Rbcat.colorize(line, colorizer_options)
    rescue Errno::EPIPE
      exit(74)
    end
  end
end