class Pfm::Command::Generate

def run(params)

def run(params)
  if generator_spec = generator_for(params[0])
    params.shift
    generator = GeneratorCommands.build(generator_spec.class_name, params)
    generator.run
  else
    msg(banner)
    1
  end
rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e
  # Pfm::Command::Base also handles this error in the same way, but it
  # does not have access to the correct option parser, so it cannot print
  # the usage correctly. Therefore, invalid CLI usage needs to be handled
  # here.
  err("ERROR: #{e.message}\n")
  msg(generator.opt_parser)
  1
end