Method: Puppet::Util::CommandLine::NilSubcommand#run

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

#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.



169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/puppet/util/command_line.rb', line 169

def run
  args = @command_line.args
  if args.include? "--version" or args.include? "-V"
    puts Puppet.version
  elsif @command_line.subcommand_name.nil? && args.count > 0
    # If the subcommand is truly nil and there is an arg, it's an option; print out the invalid option message
    puts colorize(:hred, _("Error: Could not parse application options: invalid option: %{opt}") % { opt: args[0] })
    exit 1
  else
    puts _("See 'puppet help' for help on available puppet subcommands")
  end
end