Class: IconCreater::Parser

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

Instance Method Summary collapse

Instance Method Details

#parseObject



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

def parse

  inp = Input.new;

  OptionParser.new do |opts|
    opts.banner = "Usage: iconCreater [intrerval]  [arguments...]"

    opts.on("-i", "--icon ICON", "Set The Path of Icon") do |i|
      inp.iconPath = i;
    end
    opts.on("-o", "--output OUTPUT", "Set The Path of Output") do |o|
      inp.outputPath = o;
    end
    opts.on("-v", "--version", "Print the version") do
      p IconCreater::VERSION
      exit 0
    end
    opts.on("-h", "--help", "Print the help") do
      puts opts
      exit 0
    end
  end.parse!

  inp
end