Signed-off-by: Rein Henrichs <[email protected]>
---
 bin/facter                |    3 +++
 lib/facter/application.rb |    9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/bin/facter b/bin/facter
index e9dfc7c..328d5fc 100755
--- a/bin/facter
+++ b/bin/facter
@@ -33,6 +33,9 @@
 # debug::
 #   Enable debugging.
 #
+# trace::
+#   Enable backtraces.
+#
 # = Example
 #
 #   facter kernel
diff --git a/lib/facter/application.rb b/lib/facter/application.rb
index 51dbd14..b80d07c 100644
--- a/lib/facter/application.rb
+++ b/lib/facter/application.rb
@@ -44,8 +44,12 @@ module Facter
       end
 
     rescue => e
-      $stderr.puts "Error: #{e}"
-      exit(12)
+      if options && options[:trace]
+        raise e
+      else
+        $stderr.puts "Error: #{e}"
+        exit(12)
+      end
     end
 
     private
@@ -54,6 +58,7 @@ module Facter
       options = {}
       OptionParser.new do |opts|
         opts.on("-y", "--yaml")   { |v| options[:yaml]   = v }
+        opts.on(      "--trace")  { |v| options[:trace]  = v }
 
         opts.on("-d", "--debug")  { |v| Facter.debugging(1) }
         opts.on("-p", "--puppet") { |v| load_puppet }
-- 
1.7.0.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to