diff options
| author | Zack Hobson | 2009-07-21 10:53:43 -0700 |
|---|---|---|
| committer | Zack Hobson | 2009-07-21 10:53:43 -0700 |
| commit | 30239dc8f61b86335eb8a4de9bdbbe38b425aa0b (patch) | |
| tree | 45688ede37e2a57bb7685d4bebb7e978b9e73bbe /lib/hcl.rb | |
| parent | 538986dd21356b248806fc979998caa64cdedb50 (diff) | |
| download | hcl-30239dc8f61b86335eb8a4de9bdbbe38b425aa0b.tar.bz2 | |
Added stop command, closes #5.
Diffstat (limited to 'lib/hcl.rb')
| -rw-r--r-- | lib/hcl.rb | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -122,12 +122,23 @@ EOM puts "Started timer for #{task}" end + def stop + entry = DayEntry.with_timer + if entry + entry.toggle + puts "Stopped #{entry}" + else + puts "No running timers found." + end + end + def show *args date = args.empty? ? nil : Chronic.parse(args.join(' ')) total_hours = 0.0 DayEntry.all(date).each do |day| # TODO more information and formatting options - puts "\t#{as_hours day.hours}\t#{day.project} #{day.notes}"[0..78] + running = day.running? ? '(running) ' : '' + puts "\t#{as_hours day.hours}\t#{running}#{day.project} #{day.notes}"[0..78] total_hours = total_hours + day.hours.to_f end puts "\t" + '-' * 13 @@ -145,7 +156,6 @@ EOM end # TODO implement the following commands - alias stop not_implemented alias add not_implemented alias rm not_implemented |
