diff options
| author | Zack Hobson | 2013-11-22 10:54:03 -0800 |
|---|---|---|
| committer | Zack Hobson | 2013-11-22 10:54:03 -0800 |
| commit | 6f8f7812e896c58cec91fc682528969b58807d41 (patch) | |
| tree | 7aeb6e2869e8cdd22cc6bb18810b7a1a53cfbfc6 | |
| parent | acd4a95dd66990e6afa750367532acdd4267ad81 (diff) | |
| download | hcl-6f8f7812e896c58cec91fc682528969b58807d41.tar.bz2 | |
note command: show notes with no args.
| -rw-r--r-- | CHANGELOG | 1 | ||||
| -rw-r--r-- | README.markdown | 6 | ||||
| -rw-r--r-- | lib/hcl/commands.rb | 9 |
3 files changed, 13 insertions, 3 deletions
@@ -4,6 +4,7 @@ * added --reauth option to refresh credentials * added support for retrying on API throttle +* note command without args now displays all notes for a running timer == v0.4.6 2013-11-21 diff --git a/README.markdown b/README.markdown index 590bd7b..8f638f2 100644 --- a/README.markdown +++ b/README.markdown @@ -62,6 +62,12 @@ While a task is running you can append lines to the task notes: $ hcl note Then I did something else +**Note** that `show` only displays the last line of the timer notes. +You can list all the notes for a running timer by issuing the note +command without any arguments: + + $ hcl note + ### Stopping a Timer The following command will stop a running timer (currently only one timer at diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb index d1861de..9c7e913 100644 --- a/lib/hcl/commands.rb +++ b/lib/hcl/commands.rb @@ -108,11 +108,14 @@ module HCl end def note *args - message = args.join ' ' entry = DayEntry.with_timer if entry - entry.append_note message - "Added note to #{entry}." + if args.empty? + return entry.notes + else + entry.append_note args.join(' ') + "Added note to #{entry}." + end else puts "No running timers found." exit 1 |
