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
61
62
|
# File 'lib/bun/arguments.rb', line 20
def parse
opt_parser = OptionParser.new do |opts|
opts.banner = Bun::Messages::USAGE
opts.on("-P", "--print", "# Just print the gem name and version and exit.") do
self.print = true
end
opts.on("-o", "--optimistic", "# Use optimistic version range >= instead of ~>.") do
self.optimistic = true
end
opts.on("-S", "--strict", "# Use strict version instead of ~> range.") do
self.strict = true
end
opts.on("-d", "--development", "# Add gem to development group.") do
self.group = :development
end
opts.on("-t", "--test", "# Add gem to test group.") do
self.group = :test
end
opts.on("-s", "--skip-install", "# Skip the install step.") do
self.skip_install = true
end
opts.on_tail("-h", "--help", "# Print these usage instructions.") do
puts opts
end
opts.on("-v", "--version", "# Show current Bun version.") do
puts Bun::VERSION
end
end
begin
opt_parser.parse(arguments)
rescue OptionParser::InvalidOption
puts opt_parser
end
end
|