Class: Packcr::Cli

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(argv) ⇒ Object



7
8
9
# File 'lib/packcr/cli.rb', line 7

def run(argv)
  new.run(argv)
end

Instance Method Details

#run(argv) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/packcr/cli.rb', line 12

def run(argv)
  lang = nil
  debug = false
  ascii = false
  opt = OptionParser.new
  opt.on("-l", "--lang=VAL") { |v| lang = v.to_sym }
  opt.on("-d", "--debug") { |_v| debug = true }
  opt.on("-a", "--ascii") { |_v| ascii = true }

  opt.parse!(argv)
  argv.each do |ifile|
    ::Packcr.new(ifile, lang: lang, debug: debug, ascii: ascii).run
  end
end