diff options
| author | Zack Hobson | 2009-07-17 16:02:48 -0700 |
|---|---|---|
| committer | Zack Hobson | 2009-07-17 16:02:48 -0700 |
| commit | 8db6dee90d5258b7861668ccb8aac82733f6e2dd (patch) | |
| tree | 42165e05b2ece7118f450792f2979cbca95d852a /lib | |
| parent | 3df28c93ba49fcef9f42b7e8192e8e4de778d189 (diff) | |
| download | hcl-8db6dee90d5258b7861668ccb8aac82733f6e2dd.tar.bz2 | |
more ui tweaks.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl.rb | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -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 |
