summaryrefslogtreecommitdiff
path: root/doc/ruby/short_range.rb
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2021-04-09 08:21:34 -0500
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-11 08:52:50 +0900
commitc795f30ef00e5d428b4ffaf95e91d61f4a26a505 (patch)
treed287c0292e4a25859a241e648242be09a9e4c4c7 /doc/ruby/short_range.rb
parent97abd0f6afeeab287b371e9ccc5dd28a33d13a83 (diff)
[ruby/optparse] Reorganize Ruby example files for sharing (#14)
https://github.com/ruby/optparse/commit/9a2352c1c9
Diffstat (limited to 'doc/ruby/short_range.rb')
-rw-r--r--doc/ruby/short_range.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/ruby/short_range.rb b/doc/ruby/short_range.rb
new file mode 100644
index 0000000000..f5b870a4bd
--- /dev/null
+++ b/doc/ruby/short_range.rb
@@ -0,0 +1,6 @@
+require 'optparse'
+parser = OptionParser.new
+parser.on('-[!-~]', 'Short names in (very large) range') do |name, value|
+ p ['!-~', name, value]
+end
+parser.parse!