lib/herodot/commands.rb in herodot-0.1.7 vs lib/herodot/commands.rb in herodot-0.1.8

- old
+ new

@@ -7,15 +7,15 @@ "project=$(pwd)\n"\ "branch=$(git rev-parse --abbrev-ref HEAD)\n"\ 'echo "$(date);$project;$branch" >> ~/worklog'.freeze DEFAULT_RANGE = 'this week'.freeze - def self.show(args, config) + def self.show(args, config, opts = {}) subject = args.empty? ? DEFAULT_RANGE : args.join(' ') range = Chronic.parse(subject, guess: false, context: :past) abort "Date not parsable: #{args.join(' ')}" unless range worklog = Herodot::Parser.parse(range, config) - output = Herodot::Table.print(worklog.totals) + output = Herodot::Output.print(worklog.totals, opts) puts output end def self.track(path, config) path = '.' if path.nil?