From 8c4d0cd4d25534f0f585773b6b5ff70b8a5617f9 Mon Sep 17 00:00:00 2001 From: Rein Henrichs Date: Mon, 4 Oct 2010 12:18:02 -0700 Subject: (#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 --- lib/facter/application.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/facter/application.rb') 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! -- cgit