PHP 8.2.31
Preview: date.rb Size: 356 B
/proc/thread-self/root/opt/alt/ruby23/lib64/ruby/2.3.0/optparse/date.rb

# frozen_string_literal: false
require 'optparse'
require 'date'

OptionParser.accept(DateTime) do |s,|
  begin
    DateTime.parse(s) if s
  rescue ArgumentError
    raise OptionParser::InvalidArgument, s
  end
end
OptionParser.accept(Date) do |s,|
  begin
    Date.parse(s) if s
  rescue ArgumentError
    raise OptionParser::InvalidArgument, s
  end
end

Directory Contents

Dirs: 0 × Files: 6

Name Size Perms Modified Actions
1.40 KB lrw-r--r-- 2015-12-16 05:07:31
Edit Download
356 B lrw-r--r-- 2015-12-16 05:07:31
Edit Download
152 B lrw-r--r-- 2015-12-16 05:07:31
Edit Download
219 B lrw-r--r-- 2015-12-16 05:07:31
Edit Download
131 B lrw-r--r-- 2015-12-16 05:07:31
Edit Download
2.01 KB lrw-r--r-- 2015-12-16 05:07:31
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).