Class: Flico::CommandLineInterface

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

Class Method Summary collapse

Class Method Details

.parse_args(args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/flico.rb', line 9

def self.parse_args(args)
  options = {}
  OptionParser.new do |opts|
    opts.banner = 'Usage: flico [options] [10 keywords with space as delimiter]'
    opts.on('-f', '--file_name [FileName]', 'Collage FileName') do |f|
      options[:file_name] = f
    end
  end.parse!(args)
  [args, options]
end

.start(args) ⇒ Object



20
21
22
23
# File 'lib/flico.rb', line 20

def self.start(args)
  keywords, options = parse_args(args)
  App.new(keywords, options).create
end