# File lib/juicer/command/merge.rb, line 95
      def execute(args)
        if (files = files(args)).length == 0
          @log.fatal "Please provide atleast one input file"
          raise SystemExit.new("Please provide atleast one input file")
        end

        # Copy hosts to local_hosts if --all-hosts-local was specified
        @local_hosts = @hosts if @all_hosts_local

        # Figure out which file to output to
        output = output(files.first)

        # Warn if file already exists
        if File.exists?(output) && !@force
          msg = "Unable to continue, #{output} exists. Run again with --force to overwrite"
          @log.fatal msg
          raise SystemExit.new(msg)
        end

        # Set up merger to resolve imports and so on. Do not touch URLs now, if
        # asset host cycling is added at this point, the cache buster WILL be
        # confused
        merger = merger(output).new(files, :relative_urls => @relative_urls,
                                           :absolute_urls => @absolute_urls,
                                           :document_root => @document_root,
                                           :hosts => @hosts)

        # Fail if syntax trouble (js only)
        if @verify && !Juicer::Command::Verify.check_all(merger.files.reject { |f| f =~ /\.css$/ }, @log)
          @log.error "Problems were detected during verification"
          raise SystemExit.new("Input files contain problems") unless @ignore
          @log.warn "Ignoring detected problems"
        end

        # Set command chain and execute
        merger.set_next(image_embed(output)).set_next(cache_buster(output)).set_next(minifyer)
        merger.save(output)

        # Print report
        @log.info "Produced #{relative output} from"
        merger.files.each { |file| @log.info "  #{relative file}" }
      rescue FileNotFoundError => err
        # Handle missing document-root option
        puts err.message.sub(/:document_root/, "--document-root")
      end