summaryrefslogtreecommitdiff
path: root/doc/option_params/time.rb
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2021-04-07 09:01:52 -0500
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-28 20:13:38 +0900
commita4631a427367766517c8920d323dcd96a835b06c (patch)
tree0b6f855d6155c46c5dfc1ea3940dcda5e3e39d40 /doc/option_params/time.rb
parent05e9efa323eb99727b099590c1d40d23f38443ef (diff)
[ruby/optparse] Enhanced doc for option parameters (https://github.com/ruby/optparse/pull/11)
https://github.com/ruby/optparse/commit/5618eeb49e
Diffstat (limited to 'doc/option_params/time.rb')
-rw-r--r--doc/option_params/time.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/option_params/time.rb b/doc/option_params/time.rb
new file mode 100644
index 0000000000..aa8b0cfa16
--- /dev/null
+++ b/doc/option_params/time.rb
@@ -0,0 +1,6 @@
+require 'optparse/time'
+parser = OptionParser.new
+parser.on('--time=TIME', Time) do |value|
+ p [value, value.class]
+end
+parser.parse!