summaryrefslogtreecommitdiffstats
path: root/lib/hcl.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hcl.rb')
-rw-r--r--lib/hcl.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/hcl.rb b/lib/hcl.rb
index 9d80a8d..d0d6a9a 100644
--- a/lib/hcl.rb
+++ b/lib/hcl.rb
@@ -47,16 +47,18 @@ class HCl
def process_args *args
Trollop::options(args) do
version "HCl #{VERSION}"
+ stop_on %w[ show tasks set unset note add rm start stop ]
banner <<-EOM
HCl is a command-line client for manipulating Harvest time sheets.
Commands:
hcl show [date]
hcl tasks
- hcl add <task> <duration> [msg]
- hcl rm [entry_id]
hcl start <task> [msg]
hcl stop [msg]
+ hcl note <msg>
+ hcl add <task> <duration> [msg]
+ hcl rm [entry_id]
Examples:
$ hcl tasks
@@ -66,7 +68,6 @@ Examples:
Options:
EOM
- stop_on %w[ show tasks set unset add rm start stop ]
end
@command = args.shift
@args = args
@@ -134,6 +135,17 @@ EOM
end
end
+ def note *args
+ message = args.join ' '
+ entry = DayEntry.with_timer
+ if entry
+ entry.append_note message
+ puts "Added note '#{message}' to #{entry}."
+ else
+ puts "No running timers found."
+ end
+ end
+
def show *args
date = args.empty? ? nil : Chronic.parse(args.join(' '))
total_hours = 0.0