5
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
|
# File 'lib/commitshots/options.rb', line 5
def self.get_commandline_options
options = {}
optparse = OptionParser.new do|opts|
opts.banner = "Usage: commitshots [OPTIONS] url"
options[:width] = 800
opts.on( '--width WIDTH', "Width of the browser window, defaults to #{options[:width]}" ) do |width|
options[:width] = width
end
options[:height] = 600
opts.on( '--height HEIGHT', "Height of the browser window, defaults to #{options[:height]}" ) do |height|
options[:height] = height
end
options[:backend] = 'git'
opts.on( '--backend [git|hg]', "Backend to use, defaults to #{options[:backend]}") do |backend|
options[:backend] = backend
end
opts.on( '-h', '--help', 'Display this screen' ) do
puts opts
exit
end
end
optparse.parse!
options
end
|