diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-05-12 18:29:37 -0700 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 9536723c95c5b9deff4c6c6d6423b23a7025e58b (patch) | |
tree | 61954f7006fb1f2f705bedf35f12ebd6e4f0d9eb /lib/puppet | |
parent | c338fef73a4d8d8dbd1500f0c6bb0e37c6eba8bb (diff) | |
download | puppet-9536723c95c5b9deff4c6c6d6423b23a7025e58b.tar.gz puppet-9536723c95c5b9deff4c6c6d6423b23a7025e58b.tar.xz puppet-9536723c95c5b9deff4c6c6d6423b23a7025e58b.zip |
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 <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/util/command_line.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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}" |