PHP 8.2.31
Preview: date.rb Size: 368 B
/proc/thread-self/root/opt/alt/ruby40/share/ruby/optparse/date.rb

# frozen_string_literal: false
require_relative '../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: 7

Name Size Perms Modified Actions
1.99 KB lrw-r--r-- 2026-05-21 12:15:23
Edit Download
368 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
716 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
164 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
231 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
143 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
2.14 KB lrw-r--r-- 2026-05-21 12:15:23
Edit Download

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