summaryrefslogtreecommitdiffstats
path: root/lib/facter/application.rb
diff options
context:
space:
mode:
authorRein Henrichs <rein@puppetlabs.com>2010-10-04 12:18:02 -0700
committerRein Henrichs <rein@puppetlabs.com>2010-10-04 14:15:49 -0700
commit8c4d0cd4d25534f0f585773b6b5ff70b8a5617f9 (patch)
tree7c95ef7b24092651bc972452fbc51f2648293728 /lib/facter/application.rb
parent7210429e2adb35794fb334196a6141b71f519fbc (diff)
downloadfacter-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/application.rb')
-rw-r--r--lib/facter/application.rb7
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!