mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
15 lines
446 B
Ruby
15 lines
446 B
Ruby
require 'optparse'
|
|
parser = OptionParser.new
|
|
description = <<-EOT
|
|
Lorem ipsum dolor sit amet, consectetuer
|
|
adipiscing elit. Aenean commodo ligula eget.
|
|
Aenean massa. Cum sociis natoque penatibus
|
|
et magnis dis parturient montes, nascetur
|
|
ridiculus mus. Donec quam felis, ultricies
|
|
nec, pellentesque eu, pretium quis, sem.
|
|
EOT
|
|
descriptions = description.split($/)
|
|
parser.on('--xxx', *descriptions) do |value|
|
|
p ['--xxx', value]
|
|
end
|
|
parser.parse!
|