diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-04-22 12:04:10 -0700 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 7656ba73ddfd883b36a01c81147ae69e80773bce (patch) | |
tree | 5bc7cad1485bb9749ce387336b30794e3ae93aa1 /bin | |
parent | 63e2e56d3172bdc80aaca5f5ddde5811728e3c76 (diff) | |
download | puppet-7656ba73ddfd883b36a01c81147ae69e80773bce.tar.gz |
feature #2276 Single Executable: CommandLine can be instantiated
refactor CommandLine to be an object
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/puppet | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/bin/puppet b/bin/puppet index a326ba148..9b7c7d64d 100755 --- a/bin/puppet +++ b/bin/puppet @@ -69,21 +69,5 @@ #Puppet::Application[:apply].run # this is so the RDoc::usage hack can find this file -appdir = File.join('puppet', 'application') -absolute_appdir = $:.collect { |x| File.join(x,'puppet','application') }.detect{ |x| File.directory?(x) } -builtins = Dir[File.join(absolute_appdir, '*.rb')].map{|fn| File.basename(fn, '.rb')} - -usage = "Usage: puppet command <space separated arguments>" -available = "Available commands are: #{builtins.sort.join(', ')}" - require 'puppet/util/command_line' -subcommand_name = Puppet::Util::CommandLine.subcommand_name - -if subcommand_name.nil? - puts usage, available -elsif builtins.include?(subcommand_name) #subcommand - require File.join(appdir, subcommand_name) - Puppet::Application[subcommand_name].run -else - abort "Error: Unknown command #{subcommand_name}.\n#{usage}\n#{available}" -end +Puppet::Util::CommandLine.new.execute |