class Puppet::Util::CommandLine::NilSubcommand

@api private

Public Class Methods

new(command_line) click to toggle source
    # File lib/puppet/util/command_line.rb
164 def initialize(command_line)
165   @command_line = command_line
166 end

Public Instance Methods

run() click to toggle source
    # File lib/puppet/util/command_line.rb
168 def run
169   args = @command_line.args
170   if args.include? "--version" or args.include? "-V"
171     puts Puppet.version
172   elsif @command_line.subcommand_name.nil? && args.count > 0
173     # If the subcommand is truly nil and there is an arg, it's an option; print out the invalid option message
174     puts colorize(:hred, _("Error: Could not parse application options: invalid option: %{opt}") % { opt: args[0] })
175     exit 1
176   else
177     puts _("See 'puppet help' for help on available puppet subcommands")
178   end
179 end