6
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
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/gemsurance/cli.rb', line 6
def parse(*argv)
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: gemsurance [options]"
opts.separator ""
opts.separator "Options:"
opts.on("--pre", "Consider pre-release gem versions") do |lib|
options[:pre] = true
end
opts.on("--output FILE", "Output report to given file") do |file|
options[:output_file] = file
end
opts.on("--format FORMAT", "Output report to given format (html & yml available). Html by default.") do |format|
options[:formatter] = format
end
opts.on_tail("-h", "--help", "Show this help") do
puts opts
exit
end
opts.on_tail("--version", "Show version") do
puts "Gemsurance version #{Gemsurance::VERSION}"
exit
end
end
opts.parse!(argv)
options
end
|