diff options
author | Chris Schlaeger <chris@linux.com> | 2014-09-17 21:06:17 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2014-09-17 21:06:17 +0200 |
commit | 1472790af8d903d84811fe369dfca7723c43aa81 (patch) | |
tree | f7afc93c8de8b9c0b6c5ceb1c4f2d269fdbfba45 | |
parent | 5eb7bcc8381082f5bcd4b69de40c3b4595152be6 (diff) | |
download | postrunner-1472790af8d903d84811fe369dfca7723c43aa81.zip |
Fix: Don't crash on unknown command line options.
-rw-r--r-- | lib/postrunner/Main.rb | 6 | ||||
-rw-r--r-- | lib/postrunner/UserProfileView.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/postrunner/Main.rb b/lib/postrunner/Main.rb index 2f2092f..6cb4f90 100644 --- a/lib/postrunner/Main.rb +++ b/lib/postrunner/Main.rb @@ -158,7 +158,11 @@ EOT end - parser.parse!(args) + begin + parser.parse!(args) + rescue OptionParser::InvalidOption + Log.fatal "#{$!}" + end end def execute_command(args) diff --git a/lib/postrunner/UserProfileView.rb b/lib/postrunner/UserProfileView.rb index 81cc5ad..3ff4341 100644 --- a/lib/postrunner/UserProfileView.rb +++ b/lib/postrunner/UserProfileView.rb @@ -47,7 +47,7 @@ module PostRunner unit = { :metric => 'm', :statute => 'ft' }[@unit_system] height = profile.get_as('height', unit) t.cell('Height:', { :width => '40%' }) - t.cell("#{'%.1f' % height} #{unit}", { :width => '60%' }) + t.cell("#{'%.2f' % height} #{unit}", { :width => '60%' }) t.new_row end if profile.weight |