summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZack Hobson2013-11-22 10:54:03 -0800
committerZack Hobson2013-11-22 10:54:03 -0800
commit6f8f7812e896c58cec91fc682528969b58807d41 (patch)
tree7aeb6e2869e8cdd22cc6bb18810b7a1a53cfbfc6
parentacd4a95dd66990e6afa750367532acdd4267ad81 (diff)
downloadhcl-6f8f7812e896c58cec91fc682528969b58807d41.tar.bz2
note command: show notes with no args.
-rw-r--r--CHANGELOG1
-rw-r--r--README.markdown6
-rw-r--r--lib/hcl/commands.rb9
3 files changed, 13 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fd57722..0c8a926 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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