diff --git a/lib/furik/cli.rb b/lib/furik/cli.rb index e78863b..6cd4815 100644 --- a/lib/furik/cli.rb +++ b/lib/furik/cli.rb @@ -46,20 +46,26 @@ def pulls method_option :since, type: :numeric, aliases: '-d', default: 0 method_option :from, type: :string, aliases: '-f', default: Date.today.to_s method_option :to, type: :string, aliases: '-t', default: Date.today.to_s + method_option :on, type: :string, aliases: '-o' def activity - from = Date.parse(options[:from]) - to = Date.parse(options[:to]) + on = Date.parse(options[:on]) if options[:on] + from = on || Date.parse(options[:from]) + to = on || Date.parse(options[:to]) since = options[:since] diff = (to - from).to_i diff.zero? ? from -= since : since = diff - period = case since - when 999 then 'All' - when 0 then "Today's" - else "#{since + 1}days" + if on + puts "Activities on #{on}" + else + period = case since + when 999 then 'All' + when 0 then "Today's" + else "#{since + 1}days" + end + puts "#{period} Activities" end - puts "#{period} Activities" puts '-' puts '' diff --git a/lib/furik/version.rb b/lib/furik/version.rb index 19ae27b..9891cfc 100644 --- a/lib/furik/version.rb +++ b/lib/furik/version.rb @@ -1,3 +1,3 @@ module Furik - VERSION = "0.1.3" + VERSION = "0.1.4" end