Method: Puppet::Util::CommandLine#execute

Defined in:
lib/vendor/puppet/util/command_line.rb

#executeObject



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/vendor/puppet/util/command_line.rb', line 57

def execute
  if subcommand_name and available_subcommands.include?(subcommand_name) then
    require_application subcommand_name
    app = Puppet::Application.find(subcommand_name).new(self)
    Puppet::Plugins.on_application_initialization(:appliation_object => self)

    # See the note in 'warn_later' down below. --daniel 2011-06-01
    if $delayed_deprecation_warning_for_p_u_cl.is_a? String then
      Puppet.deprecation_warning($delayed_deprecation_warning_for_p_u_cl)
      $delayed_deprecation_warning_for_p_u_cl = true
    end

    app.run
  elsif ! execute_external_subcommand then
    unless subcommand_name.nil? then
      puts "Error: Unknown Puppet subcommand '#{subcommand_name}'"
    end
    puts "See 'puppet help' for help on available puppet subcommands"
  end
end