class OptimistXL::DateOption

Option for dates. No longer uses Chronic if available. If chronic style dates are needed, then you may require 'optimist_xl/chronic'

Public Instance Methods

parse(paramlist, _neg_given) click to toggle source
# File lib/optimist_xl.rb, line 1246
def parse(paramlist, _neg_given)
  paramlist.map do |pg|
    pg.map do |param|
      next param if param.is_a?(Date)
      begin
        Date.parse(param)
      rescue ArgumentError
        raise CommandlineError, "option '#{self.name}' needs a date"
      end
    end
  end
end
type_format() click to toggle source
# File lib/optimist_xl.rb, line 1245
def type_format ; "=<date>" ; end