diff options
author | Rein Henrichs <rein@puppetlabs.com> | 2010-10-04 12:18:02 -0700 |
---|---|---|
committer | Rein Henrichs <rein@puppetlabs.com> | 2010-10-04 14:15:49 -0700 |
commit | 8c4d0cd4d25534f0f585773b6b5ff70b8a5617f9 (patch) | |
tree | 7c95ef7b24092651bc972452fbc51f2648293728 /lib/facter | |
parent | 7210429e2adb35794fb334196a6141b71f519fbc (diff) | |
download | facter-8c4d0cd4d25534f0f585773b6b5ff70b8a5617f9.tar.gz facter-8c4d0cd4d25534f0f585773b6b5ff70b8a5617f9.tar.xz facter-8c4d0cd4d25534f0f585773b6b5ff70b8a5617f9.zip |
(#4558) Fail with message on --help errors
If rdoc/usage fails to load, tell the user why and fail. If another
failure happens, report the error message and fail.
Paired With: Jacob Helwig
Signed-off-by: Rein Henrichs <rein@puppetlabs.com>
Diffstat (limited to 'lib/facter')
-rw-r--r-- | lib/facter/application.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/facter/application.rb b/lib/facter/application.rb index 51dbd14..36d070b 100644 --- a/lib/facter/application.rb +++ b/lib/facter/application.rb @@ -68,8 +68,13 @@ module Facter require 'rdoc/ri/ri_paths' require 'rdoc/usage' puts RDoc.usage - ensure exit + rescue LoadError + $stderr.puts "No help available unless your RDoc has RDoc.usage" + exit(1) + rescue => e + $stderr.puts "fatal: #{e}" + exit(1) end end end.parse! |