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/array.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 doc/ruby/array.rb (limited to 'doc/ruby/array.rb') diff --git a/doc/ruby/array.rb b/doc/ruby/array.rb new file mode 100644 index 0000000000..7c6c14fad4 --- /dev/null +++ b/doc/ruby/array.rb @@ -0,0 +1,6 @@ +require 'optparse' +parser = OptionParser.new +parser.on('--array=ARRAY', Array) do |value| + p [value, value.class] +end +parser.parse! -- cgit v1.2.3