summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Scharf2009-11-05 10:16:24 -0500
committerbricooke2010-09-21 12:35:38 -0600
commit92528d1f63ab83baa5764a0350fa1ad47e0d4bf2 (patch)
tree2ad7b84e857fced3f0b68582788c3798cae181f4 /lib
parentc3176bfacd2d08c556708cb955b5d456acb93a6f (diff)
downloadhcl-92528d1f63ab83baa5764a0350fa1ad47e0d4bf2.tar.bz2
show current time when on 'start', 'stop', and 'show' commands
Diffstat (limited to 'lib')
-rw-r--r--lib/hcl/commands.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb
index fcf6939..9e59a90 100644
--- a/lib/hcl/commands.rb
+++ b/lib/hcl/commands.rb
@@ -51,14 +51,14 @@ module HCl
exit 1
end
timer = task.start(:starting_time => starting_time, :note => args.join(' '))
- puts "Started timer for #{timer}."
+ puts "Started timer for #{timer} (at #{current_time})"
end
-
+
def stop
entry = DayEntry.with_timer
if entry
entry.toggle
- puts "Stopped #{entry}."
+ puts "Stopped #{entry} (at #{current_time})"
else
puts "No running timers found."
end
@@ -84,7 +84,12 @@ module HCl
total_hours = total_hours + day.hours.to_f
end
puts "\t" + '-' * 13
- puts "\t#{as_hours total_hours}\ttotal"
+ puts "\t#{as_hours total_hours}\ttotal (as of #{current_time})"
+ end
+
+ private
+ def current_time
+ Time.now.strftime('%I:%M %p').downcase
end
end
end