From deff92d2bb830179fd68c42c02b193055b9b57be Mon Sep 17 00:00:00 2001 From: Rein Henrichs Date: Tue, 30 Mar 2010 17:10:44 -0700 Subject: Find both bin and sbin usage docs, fail gracefully --- lib/puppet/application.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb index 0b8e3d9d4..8597bd652 100644 --- a/lib/puppet/application.rb +++ b/lib/puppet/application.rb @@ -89,7 +89,7 @@ require 'optparse' class Puppet::Application include Puppet::Util - SBINDIR = File.expand_path(File.dirname(__FILE__)) + '/../../sbin' + BINDIRS = File.expand_path(File.dirname(__FILE__)) + '/../../{sbin,bin}' @@applications = {} def self.applications; @@applications end @@ -299,14 +299,17 @@ class Puppet::Application # RH:FIXME: My goodness, this is ugly. ::RDoc.const_set("PuppetSourceFile", @name) def (::RDoc).caller - file = `grep -l 'Puppet::Application\\[:#{::RDoc::PuppetSourceFile}\\]' #{SBINDIR}/*`.chomp - super << "#{file}:0" + docfile = `grep -l 'Puppet::Application\\[:#{::RDoc::PuppetSourceFile}\\]' #{BINDIRS}/*`.chomp + super << "#{docfile}:0" end ::RDoc::usage && exit else puts "No help available unless you have RDoc::usage installed" exit end + rescue Errno::ENOENT + puts "No help available for puppet #@name" + exit end private -- cgit