summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZack Hobson2009-07-17 16:02:48 -0700
committerZack Hobson2009-07-17 16:02:48 -0700
commit8db6dee90d5258b7861668ccb8aac82733f6e2dd (patch)
tree42165e05b2ece7118f450792f2979cbca95d852a /lib
parent3df28c93ba49fcef9f42b7e8192e8e4de778d189 (diff)
downloadhcl-8db6dee90d5258b7861668ccb8aac82733f6e2dd.tar.bz2
more ui tweaks.
Diffstat (limited to 'lib')
-rw-r--r--lib/hcl.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/hcl.rb b/lib/hcl.rb
index 09bef74..193f93f 100644
--- a/lib/hcl.rb
+++ b/lib/hcl.rb
@@ -14,15 +14,16 @@ class HCl
def self.command *args
command = args.shift
- unless command
- help
- return
- end
hcl = new(@@conf_file).process_args *args
- if hcl.respond_to? command
- hcl.send command
+ if command
+ if hcl.respond_to? command
+ hcl.send command
+ else
+ raise UnknownCommand, "unrecognized command `#{command}'"
+ end
else
- raise UnknownCommand, "unrecognized command `#{command}'"
+ hcl.show
+ return
end
end
@@ -53,10 +54,11 @@ class HCl
total_hours = 0.0
DayEntry.all.each do |day|
# TODO more information and formatting options
- puts "#{day.task} / #{day.hours}"
+ puts "\t#{day.hours}\t#{day.project} (#{day.notes})"[0..78]
total_hours = total_hours + day.hours.to_f
end
- puts "Total #{total_hours} hours"
+ puts "\t" + '-' * 13
+ puts "\t#{total_hours}\ttotal"
end
def not_implemented