Looks quite reasonable to me, though it would probably be a good idea to add --trace to the documentation in bin/facter, too.
-- Jacob Helwig On Mon, 04 Oct 2010 11:34:00 -0700, Jacob Helwig wrote: > > From: Rein Henrichs <[email protected]> > > Signed-off-by: Rein Henrichs <[email protected]> > --- > > From http://projects.puppetlabs.com/issues/4563 > > lib/facter/application.rb | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) > > 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.3 >
signature.asc
Description: Digital signature
