17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/xmk.rb', line 17
def self.main()
@@targets = Array.new
@@platforms = Array.new
@@labels = Array.new
options = {}
options[:verbose] = false
options[:skipcomp] = false
options[:disable_cmd] = false
optparse = OptionParser.new do|opts|
opts.banner = "Usage: xmk [options]"
opts.on('-h', '--help', 'Display this screen') do
puts opts
exit
end
opts.on('-t', '--target TARGET', 'Target') do |arg|
@@targets.push(arg)
end
opts.on('-p', '--platform PLATFORM', 'Platform') do |arg|
@@platforms.push(arg)
end
opts.on('-l', '--label LABEL', 'Label') do |arg|
@@labels.push(arg)
end
opts.on('-v', '--verbose', 'Verbose mode') do
options[:verbose] = true
end
opts.on('-s', '--skip-compilation', 'Skip compilation') do
options[:skipcomp] = true
end
opts.on('-d', '--disable-commands', 'Disable commands') do
options[:disable_cmd] = true
end
end
optparse.parse!
@@options = options
lexer = Lexer.new
Parser.new(lexer.scan).parse
end
|