From 9536723c95c5b9deff4c6c6d6423b23a7025e58b Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Wed, 12 May 2010 18:29:37 -0700 Subject: Feature #2935: method extract require_application It's useful to be able to require specific applications' ruby source by name, even if we aren't about to run them. Signed-off-by: Jesse Wolfe --- lib/puppet/util/command_line.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/puppet') diff --git a/lib/puppet/util/command_line.rb b/lib/puppet/util/command_line.rb index 4ab6d317c..9003a0c1a 100644 --- a/lib/puppet/util/command_line.rb +++ b/lib/puppet/util/command_line.rb @@ -40,11 +40,15 @@ module Puppet [usage, available].join("\n") end + def require_application(application) + require File.join(appdir, application) + end + def execute if subcommand_name.nil? puts usage_message elsif available_subcommands.include?(subcommand_name) #subcommand - require File.join(appdir, subcommand_name) + require_application subcommand_name Puppet::Application.find(subcommand_name).new(self).run else abort "Error: Unknown command #{subcommand_name}.\n#{usage_message}" -- cgit