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
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/micron/app/options.rb', line 33
def self.parse_opts(options, argv)
parser = OptionParser.new do |opts|
opts.banner = "usage: #{$0} [options]"
opts.on("--nocov", "Disable coverage reporting") {
options[:coverage] = false
}
opts.on("--proc", "Use the process runner") {
options[:proc] = true
}
opts.on("--fork", "Use the forking runner") {
options[:fork] = true
}
opts.on("--runclass", "Run class in child process") {
options[:runclass] = true
}
opts.on("--runmethod", "Run method in child process") {
options[:runmethod] = true
}
end
begin
parser.parse!(argv)
rescue Exception => ex
exit if ex.kind_of? SystemExit
STDERR.puts "error: #{ex}"
STDERR.puts
STDERR.puts parser
exit 1
end
return options
end
|