summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRein Henrichs <reinh@reinh.com>2010-03-30 17:10:44 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitdeff92d2bb830179fd68c42c02b193055b9b57be (patch)
tree834463cfe6a895a76d380700a39e822d97fd1368 /lib
parent3c8d0122c3d29e1e2877ff813cd953edb31550f2 (diff)
downloadpuppet-deff92d2bb830179fd68c42c02b193055b9b57be.tar.gz
puppet-deff92d2bb830179fd68c42c02b193055b9b57be.tar.xz
puppet-deff92d2bb830179fd68c42c02b193055b9b57be.zip
Find both bin and sbin usage docs, fail gracefully
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/application.rb9
1 files changed, 6 insertions, 3 deletions
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