Class: Cbr2cbz::CLI

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

Class Method Summary collapse

Class Method Details

.startObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cbr2cbz/cli.rb', line 5

def self.start
  options = {}
  opts = OptionParser.new do |opts|
    opts.banner = "Usage: cbr2cbz [options] file ..."

    opts.on("-k", "--keep", "Keep original file") do |k|
      options[:keep] = k
    end

    opts.on("-v", "--verbose", "Run verbosely") do |v|
      options[:verbose] = v
    end

    opts.on_tail("-h", "--help", "Show this message") do
      puts opts
      exit
    end
  end
  opts.parse!

  if ARGV.empty? 
    puts opts
  else
    Converter.new(options).convert(ARGV)
  end
end