date.coffee 321 B

12345678910
  1. options = require('../lib/dreamopt') [
  2. " -f, --from DATE Only process records from the given date #date"
  3. ], {
  4. date: (value, options, optionName) ->
  5. if isNaN(new Date(value))
  6. throw new Error("Invalid date for option #{optionName}")
  7. new Date(value)
  8. }
  9. console.log "Year: " + options.from?.getFullYear()