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