Class: Puppet::Util::CommandLine::UnknownSubcommand Private

Inherits:
NilSubcommand show all
Defined in:
lib/puppet/util/command_line.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary

Constants included from Puppet::Util::Colors

Puppet::Util::Colors::BG_BLUE, Puppet::Util::Colors::BG_CYAN, Puppet::Util::Colors::BG_GREEN, Puppet::Util::Colors::BG_HBLUE, Puppet::Util::Colors::BG_HCYAN, Puppet::Util::Colors::BG_HGREEN, Puppet::Util::Colors::BG_HMAGENTA, Puppet::Util::Colors::BG_HRED, Puppet::Util::Colors::BG_HWHITE, Puppet::Util::Colors::BG_HYELLOW, Puppet::Util::Colors::BG_MAGENTA, Puppet::Util::Colors::BG_RED, Puppet::Util::Colors::BG_WHITE, Puppet::Util::Colors::BG_YELLOW, Puppet::Util::Colors::BLACK, Puppet::Util::Colors::BLUE, Puppet::Util::Colors::CYAN, Puppet::Util::Colors::Colormap, Puppet::Util::Colors::GREEN, Puppet::Util::Colors::HBLACK, Puppet::Util::Colors::HBLUE, Puppet::Util::Colors::HCYAN, Puppet::Util::Colors::HGREEN, Puppet::Util::Colors::HMAGENTA, Puppet::Util::Colors::HRED, Puppet::Util::Colors::HWHITE, Puppet::Util::Colors::HYELLOW, Puppet::Util::Colors::MAGENTA, Puppet::Util::Colors::RED, Puppet::Util::Colors::RESET, Puppet::Util::Colors::WHITE, Puppet::Util::Colors::YELLOW

Instance Method Summary collapse

Methods included from Puppet::Util::Colors

#colorize, #console_color, #html_color

Constructor Details

#initialize(subcommand_name, command_line) ⇒ UnknownSubcommand

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of UnknownSubcommand.



185
186
187
188
# File 'lib/puppet/util/command_line.rb', line 185

def initialize(subcommand_name, command_line)
  @subcommand_name = subcommand_name
  super(command_line)
end

Instance Method Details

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



190
191
192
193
194
# File 'lib/puppet/util/command_line.rb', line 190

def run
  puts colorize(:hred, _("Error: Unknown Puppet subcommand '%{cmd}'") % { cmd: @subcommand_name })
  super
  exit 1
end