From c795f30ef00e5d428b4ffaf95e91d61f4a26a505 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Fri, 9 Apr 2021 08:21:34 -0500 Subject: [ruby/optparse] Reorganize Ruby example files for sharing (#14) https://github.com/ruby/optparse/commit/9a2352c1c9 --- doc/ruby/short_simple.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/ruby/short_simple.rb (limited to 'doc/ruby/short_simple.rb') diff --git a/doc/ruby/short_simple.rb b/doc/ruby/short_simple.rb new file mode 100644 index 0000000000..d3d489e2dc --- /dev/null +++ b/doc/ruby/short_simple.rb @@ -0,0 +1,9 @@ +require 'optparse' +parser = OptionParser.new +parser.on('-x', 'One short name') do |value| + p ['-x', value] +end +parser.on('-1', '-%', 'Two short names (aliases)') do |value| + p ['-1 or -%', value] +end +parser.parse! -- cgit v1.2.3