# File lib/fpm/command.rb, line 524
  def run(run_args)
    logger.subscribe(STDOUT)

    # Short circuit for a `fpm --version` or `fpm -v` short invocation that 
    # is the user asking us for the version of fpm.
    if run_args == [ "-v" ] || run_args == [ "--version" ]
      puts FPM::VERSION
      return 0
    end

    # fpm initialization files, note the order of the following array is
    # important, try .fpm in users home directory first and then the current
    # directory
    rc_files = [ ".fpm" ]
    rc_files << File.join(ENV["HOME"], ".fpm") if ENV["HOME"]

    rc_args = []

    if ENV["FPMOPTS"]
      logger.warn("Loading flags from FPMOPTS environment variable")
      rc_args.push(*Shellwords.shellsplit(ENV["FPMOPTS"]))
    end

    rc_files.each do |rc_file|
      if File.readable? rc_file
        logger.warn("Loading flags from rc file #{rc_file}")
        rc_args.push(*Shellwords.shellsplit(File.read(rc_file)))
      end
    end

    flags = []
    args = []
    while rc_args.size > 0 do
      arg = rc_args.shift
      opt = self.class.find_option(arg)
      if opt and not opt.flag?
        flags.push(arg)
        flags.push(rc_args.shift)
      elsif opt or arg[0] == "-"
        flags.push(arg)
      else
        args.push(arg)
      end
    end

    logger.warn("Additional options: #{flags.join " "}") if flags.size > 0
    logger.warn("Additional arguments: #{args.join " "}") if args.size > 0

    ARGV.unshift(*flags)
    ARGV.push(*args)
    super(run_args)
  rescue FPM::Package::InvalidArgument => e
    logger.error("Invalid package argument: #{e}")
    return 1
  end